Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function MySQLDB(options) {
if (!(this instanceof MySQLDB)) return new MySQLDB(options);
DB.call(this, options);
this.closed = false;
mysql_config = options.db;
// connections in pool
mysql_config.connectionLimit = options.db.connectionLimit ? options.connectionLimit : 10;
pool = mysql.createPool(mysql_config);
if (options.debug) {
debug = options.debug;
pool.on('acquire', function (connection) {
console.log('Connection %d acquired', connection.threadId);
});
function PostgresDB(options) {
if (!(this instanceof PostgresDB)) return new PostgresDB(options);
DB.call(this, options);
this.closed = false;
this.pg_config = options;
};
module.exports = PostgresDB;