@onurege3467/zerohelper
Version:
ZeroHelper is a versatile JavaScript library offering helper functions and database utilities for developers. It supports MongoDB, MySQL, SQLite, Redis, and PostgreSQL.
15 lines (12 loc) • 342 B
JavaScript
;
const mysql = require('promise-mysql');
const errors = require('../errors/strings.js');
module.exports = async function(options, checkUpdates){
let me = this;
me.db = await mysql.createPool(options);
me.db.pool.getConnection((err,connection) => {
if(err) throw err;
me.emit("connected", connection);
});
return me;
}