LoRaWAN-Signal-Mapping/server/bootstrap/database_init.mjs

16 lines
309 B
JavaScript
Raw Normal View History

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