From 638dade4339f92379f7941d1023c4d3b29fe5486 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 7 Sep 2026 09:19:50 -0400 Subject: 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) --- org/out_src_abstraction_sqlite_db.org | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'org/out_src_abstraction_sqlite_db.org') diff --git a/org/out_src_abstraction_sqlite_db.org b/org/out_src_abstraction_sqlite_db.org index 31bb7ab..0b477c1 100644 --- a/org/out_src_abstraction_sqlite_db.org +++ b/org/out_src_abstraction_sqlite_db.org @@ -73,8 +73,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 ( -- cgit v1.2.3