@eventstore.net/event.store
Version:
A simple and fast EventStore that support multiple persistence and notification providers
26 lines • 790 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const connect_1 = require("./connect");
class MySQL {
constructor(config) {
this.pool = connect_1.MySQLFactory.createPool(config);
}
query(sql, args) {
return new Promise((resolve, reject) => {
this.pool.getConnection((err, connection) => {
if (err) {
return reject(err);
}
connection.query(sql, args || [], (e, rows) => {
connection.release();
if (e) {
return reject(e);
}
resolve(rows);
});
});
});
}
}
exports.MySQL = MySQL;
//# sourceMappingURL=mysql.js.map