Merge branch 'master' into clear-monitor-data

This commit is contained in:
Ponkhy
2021-09-01 17:17:40 +02:00
committed by GitHub
18 changed files with 1435 additions and 624 deletions

View File

@@ -13,9 +13,6 @@ class Database {
static async connect() {
const acquireConnectionTimeout = 120 * 1000;
R.useBetterSQLite3 = true;
R.betterSQLite3Options.timeout = acquireConnectionTimeout;
R.setup("sqlite", {
filename: Database.path,
useNullAsDefault: true,
@@ -124,11 +121,8 @@ class Database {
return statement !== "";
})
// Use better-sqlite3 to run, prevent "This statement does not return data. Use run() instead"
const db = await this.getBetterSQLite3Database();
for (let statement of statements) {
db.prepare(statement).run();
await R.exec(statement);
}
}