aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sisudoc/outputs/io_out
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2026-09-07 09:19:50 -0400
committerRalph Amissah <ralph.amissah@gmail.com>2026-09-09 17:11:51 -0400
commit638dade4339f92379f7941d1023c4d3b29fe5486 (patch)
treef1924ad887a5b49661f1a5e96842ef60ed6371c2 /src/sisudoc/outputs/io_out
parentocda: remove dead fields (diff)
sqlite db abstraction: make readable as read-only
drop WAL so the file can be read read-only: journal_mode=WAL was set in the file header and A WAL database cannot be opened by a reader that cannot also write beside it (this ruled out a read-only directory, read-only media, and anything that wants to read the artefact where it sits). (assisted by Claude-Code)
Diffstat (limited to 'src/sisudoc/outputs/io_out')
-rw-r--r--src/sisudoc/outputs/io_out/create_abstraction_db.d11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/sisudoc/outputs/io_out/create_abstraction_db.d b/src/sisudoc/outputs/io_out/create_abstraction_db.d
index ba83736..d1f3f53 100644
--- a/src/sisudoc/outputs/io_out/create_abstraction_db.d
+++ b/src/sisudoc/outputs/io_out/create_abstraction_db.d
@@ -91,8 +91,15 @@ template spineAbstractionDb() {
/+ ↓ open database and create schema +/
auto db = Database(db_file);
- db.run("PRAGMA journal_mode=WAL");
- db.run("PRAGMA synchronous=NORMAL");
+ /+ ↓ write once, read many: no WAL.
+ a WAL stamped file cannot be opened by a reader that cannot write
+ beside it (SQLITE_READONLY on a read-only directory, and inside a
+ zip or on read-only media), and this database has one writer and no
+ concurrency, so WAL buys nothing here. MEMORY journal keeps the bulk
+ load fast without leaving that mark on the file.
+ +/
+ db.run("PRAGMA journal_mode=MEMORY");
+ db.run("PRAGMA synchronous=OFF");
db.run("
CREATE TABLE metadata (