promisequel
v1.0.4
Published
promise wrapper for mysql library
Downloads
1
Maintainers
Readme
promisequel
simple mysql promise wrapper package
install :
npm i promisequel
usage example :
const promisequel = require('promisequel')
const config = {
host: process.env.DATABASE_HOST,
user: process.env.DATABASE_USER,
password: process.env.DATABASE_PASSWORD,
database: process.env.DATABASE_NAME
}
const db = new promisequel(config)
db.query('select * from `example` where id = ?', 1)
.then(result => {
console.log(result)
db.close()
}).catch(err => {
console.log(err)
})