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.
This commit is contained in:
Kyle Anthony Williams 2020-11-03 11:14:41 -05:00 committed by Cadence Ember
parent eabcfc01cf
commit 0d251779f2
No known key found for this signature in database
GPG Key ID: BC1C2C61CF521B17
2 changed files with 9 additions and 8 deletions

16
package-lock.json generated
View File

@ -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"
}

View File

@ -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