Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function setupConnectionPool() {
const dbConfig = MysqlDb.connectionParams();
dbConfig.namedPlaceholders = true;
connectionPool = mysql.createPool(dbConfig);
debug('MysqlDb.setupConnectionPool', `connect to ${dbConfig.host}/${dbConfig.database}`);
// traditional mode ensures not null is respected for unsupplied fields, ensures valid JavaScript dates, etc
await connectionPool.query('SET SESSION sql_mode = "TRADITIONAL"');
}