async function promisifyQuery(connection, query) {

  return new Promise((resolve, reject) => {

    connection.query(query, (err, results, fields) => {

      if (err) {
        reject(err);
      } else {
        resolve({ results, fields });
      }
    });
  });
}
/**
 * Utility that will return a promise which will resolve or reject depending
 * on the callback result from a SQL query using the provided connection and
 * query string
 */
Utility that will return a promise which will resolve or reject depending
on the callback result from a SQL query using the provided connection and
query string
Utility that will return a promise which will resolve or reject depending on the callback result from a SQL query using the provided connection and query string
async function promisifyQuery(connection, query) {
  return new Promise((resolve, reject) => {
    connection.query(query, (err, results, fields) => {
      if (err) {
        reject(err);
      } else {
        resolve({ results, fields });
      }
    });
  });
}
async function promisifyQuery ( connection , query ) { return new Promise ( ( resolve , reject ) => { connection . query ( query , ( err , results , fields ) => { if ( err ) { reject ( err ) ; } else { resolve ( { results , fields } ) ; } } ) ; } ) ; }
Utility that will return a promise which will resolve or reject depending
 on the callback result from a SQL query using the provided connection and
 query string
Utility that will return a promise which will resolve or reject depending on the callback result from a SQL query using the provided connection and query string