WIP: Enable background jobs

WIP: Remove better-sqlite3
This commit is contained in:
Nelson Chan
2021-09-27 23:40:38 +08:00
parent 6dd0e082b4
commit 656a4d6270
5 changed files with 570 additions and 6 deletions

View File

@@ -0,0 +1,24 @@
const path = require("path");
const { R } = require("redbean-node");
const Database = require("../database");
const dbPath = path.join(
process.env.DATA_DIR ||
require("worker_threads").workerData["data-dir"] ||
"./data/"
);
Database.init({
"data-dir": dbPath,
});
(async () => {
await Database.connect();
console.log(await R.getAll("PRAGMA journal_mode"));
console.log(
await R.getAll("SELECT * from setting WHERE key = 'database_version'")
);
process.exit(0);
})();