You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
525 B
25 lines
525 B
3 years ago
|
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);
|
||
|
})();
|