15 lines
309 B
JavaScript
15 lines
309 B
JavaScript
"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;
|