0.0.2 • Published 5 years ago

@iridium/use-knex v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

Use-knex

Usage:

const knex = require('@iridium/use-knex');
const config = {
  client: 'mysql',
  connection: {
    host : '127.0.0.1',
    user : 'your_database_user',
    password : 'your_database_password',
    database : 'myapp_test'
  }
};

const useKnex = knex(config)

// function serverless
module.exports = useKnex(async (req, res) => {
  const users = await req
    .db
    .select('*')
    .from('users'); // <- Thanks to use-knex;

  res.end();
})

License

MIT © David Bernal

0.0.2

5 years ago

0.0.1

5 years ago

0.0.0

5 years ago