I've been using the npm package 'pg' and need to switch to this npm package 'mysql'. And I've been using the 'pg' package like this:
const res = await pool.query( query );
But since the 'mysql' package uses a callback, I need to do this:
const res = await pool.query( query, function ( error, results, fields ) { return results; // ABBREVIATED } );
The callback gets fired immediately and does not return to the calling function ... now, how do I make this package work with the above method? I don't know whether this is an actual 'issue' or the package is simply just not Promisified.
I've been using the npm package 'pg' and need to switch to this npm package 'mysql'. And I've been using the 'pg' package like this:
But since the 'mysql' package uses a callback, I need to do this:
The callback gets fired immediately and does not return to the calling function ... now, how do I make this package work with the above method? I don't know whether this is an actual 'issue' or the package is simply just not Promisified.