vybe/db.js

15 lines
346 B
JavaScript
Raw Normal View History

2023-05-05 19:33:05 -07:00
const sqlite3 = require("sqlite3");
const db = new sqlite3.Database("./vybe.db");
db.query = function (sql, params) {
var that = this;
return new Promise(function (resolve, reject) {
that.all(sql, params, function (error, rows) {
if (error) reject(error);
else resolve({ rows: rows });
});
});
};
module.exports = db;