LoRaWAN-Signal-Mapping/server/Helpers/Database.mjs

19 lines
316 B
JavaScript
Raw Normal View History

"use strict";
import fs from 'fs';
import Database from 'better-sqlite3';
var db = null;
async function init(filename, options) {
db = new Database(filename, options);
db.exec(await fs.promises.readFile("../db_template.sql", "utf8"));
}
function get_instance() {
return db;
}
export { init, get_instance };