node-mariasql icon indicating copy to clipboard operation
node-mariasql copied to clipboard

Promise Support?

Open NoahCardoza opened this issue 7 years ago • 2 comments

As the title states: is there a plan for this library support promises anytime in the near future?

I'd be happy to submit a PR if this is something that you are interested in.

Thanks.

NoahCardoza avatar Jun 09 '18 02:06 NoahCardoza

Why not just make this a mariadb driver for Sequelize (https://www.npmjs.com/package/sequelize)? They have all the promise support you need, it's a wonderful ORM and super secure after years and years of code updates.

knoxcard avatar Sep 08 '18 04:09 knoxcard

It's easy to use promisify for this

const util = require('util')
    
const asyncQuery = util.promisify(c.query);
        
const rows = await asyncQuery.call(c, 'SELECT product FROM products WHERE id = :id', { id }, { useArray: false, metaData: false })

teemujonkkari avatar Jan 06 '19 21:01 teemujonkkari