From 0d251779f2f52d256cd6485dcf34c1c44f1bf96e Mon Sep 17 00:00:00 2001 From: Kyle Anthony Williams Date: Tue, 3 Nov 2020 11:14:41 -0500 Subject: [PATCH] Changed the journal mode of the SQLite DB to WAL. https://github.com/JoshuaWise/better-sqlite3/issues/262#issuecomment-549872386 https://www.sqlite.org/wal.html Just do it. It should near instanly make Bibliogram faster. --- package-lock.json | 16 ++++++++-------- src/lib/db.js | 1 + 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 25062f2..31c3004 100644 --- a/package-lock.json +++ b/package-lock.json @@ -656,9 +656,9 @@ } }, "@types/babel-types": { - "version": "7.0.8", - "resolved": "https://registry.npmjs.org/@types/babel-types/-/babel-types-7.0.8.tgz", - "integrity": "sha512-jvu8g4LR7+p6ao30RhTREnEhHxmP4/R9D9/rOR/Kq14FztORty9SKgtOZUNZNMB9CXLxZ54EWu4dArUE8WdTsw==" + "version": "7.0.9", + "resolved": "https://registry.npmjs.org/@types/babel-types/-/babel-types-7.0.9.tgz", + "integrity": "sha512-qZLoYeXSTgQuK1h7QQS16hqLGdmqtRmN8w/rl3Au/l5x/zkHx+a4VHrHyBsi1I1vtK2oBHxSzKIu0R5p6spdOA==" }, "@types/babylon": { "version": "6.16.5", @@ -3328,8 +3328,8 @@ "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==" }, "pinski": { - "version": "git+https://git.sr.ht/~cadence/nodejs-pinski#4791286f5c999dc73e17fdfa0d9a330189f4463f", - "from": "git+https://git.sr.ht/~cadence/nodejs-pinski#4791286f5c999dc73e17fdfa0d9a330189f4463f", + "version": "git+https://git.sr.ht/~cadence/nodejs-pinski#ce07b2e32e79def5938f6cff6ddc28e5a290a0de", + "from": "git+https://git.sr.ht/~cadence/nodejs-pinski#ce07b2e32e79def5938f6cff6ddc28e5a290a0de", "requires": { "mime": "^2.4.4", "pug": "^2.0.3", @@ -3940,9 +3940,9 @@ "dev": true }, "sass": { - "version": "1.26.10", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.26.10.tgz", - "integrity": "sha512-bzN0uvmzfsTvjz0qwccN1sPm2HxxpNI/Xa+7PlUEMS+nQvbyuEK7Y0qFqxlPHhiNHb1Ze8WQJtU31olMObkAMw==", + "version": "1.28.0", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.28.0.tgz", + "integrity": "sha512-9FWX/0wuE1KxwfiP02chZhHaPzu6adpx9+wGch7WMOuHy5npOo0UapRI3FNSHva2CczaYJu2yNUBN8cCSqHz/A==", "requires": { "chokidar": ">=2.0.0 <4.0.0" } diff --git a/src/lib/db.js b/src/lib/db.js index bbf470b..e78923a 100644 --- a/src/lib/db.js +++ b/src/lib/db.js @@ -5,4 +5,5 @@ const fs = require("fs") const dir = pj(__dirname, "../../db") fs.mkdirSync(pj(dir, "backups"), {recursive: true}) const db = new sqlite(pj(dir, "bibliogram.db")) +db.pragma("journal_mode = WAL") module.exports = db