async function stdMysqlQuery(con, sql) {
  return new Promise((resolve, reject) => {
    try {
      con.query(
        {
          sql,
          timeout: 500,
        },
        function (error, results, fields) {
          if (error) {
            reject(error);
          } else {
            resolve(results);
          }
        }
      );
    } catch (err) {
      reject(err); // double sure...
    }
  });
}
Test case for figuring out robust way to recognize if connection is dead
for mysql based drivers.