Turn on WAL mode for better-sqlite3

This commit is contained in:
Jeremy Ruston 2024-04-14 19:12:21 +01:00
parent 9ba4556250
commit cc4cb04900
1 changed files with 5 additions and 0 deletions

View File

@ -43,6 +43,11 @@ function SqlEngine(options) {
this.db = new Database(databasePath,{
verbose: undefined && console.log
});
// Turn on WAL mode for better-sqlite3
if(this.engine === "better") {
// See https://github.com/WiseLibs/better-sqlite3/blob/master/docs/performance.md
this.db.pragma("journal_mode = WAL");
}
}
SqlEngine.prototype.close = function() {