aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/spine.org
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2026-09-09 12:05:55 -0400
committerRalph Amissah <ralph.amissah@gmail.com>2026-09-09 20:26:27 -0400
commit12b1a42d654ac2bdde984a671b4b55ae595ae2fd (patch)
treec6f6f1c1c7e4d24112ee54ccdc4a258f348dca78 /org/spine.org
parenthtml metadata: a link to the ocda.db (diff)
sqlite: schema version, & fail run on writes fail
Spine now declares sqlite_db_schema_version and stamps it into the database as PRAGMA user_version when the tables are created, in both the shared and the discrete DDL blocks. On opening an existing database it compares, and says once per run which version it found and which it writes. Failures are now tallied (shared, the output can run in parallel), reported one line each on stderr naming the operation, and main exits 1 without printing "run complete, ok". Two tests under test/, both taking the spine binary as their first argument and building their own database from data/pod unless $SpinePOD says otherwise: test-search-db-schema.sh names: every column the search form uses exists, and spine's declaration, the database's stamp and the search form's expectation all agree test-search-cgi.sh behaviour: the real search binary answers real requests against a fresh database, no web server involved, the probe values read out of whichever database it is given (assisted by Claude-Code)
Diffstat (limited to 'org/spine.org')
-rw-r--r--org/spine.org12
1 files changed, 12 insertions, 0 deletions
diff --git a/org/spine.org b/org/spine.org
index 51926d5..86003b9 100644
--- a/org/spine.org
+++ b/org/spine.org
@@ -124,6 +124,18 @@ string program_name = "spine";
foreach (ref _dlr; _url_downloads) {
cleanupDownload(_dlr);
}
+ /+ ↓ sqlite statements that failed are fatal to the run, report and exit non-zero +/
+ {
+ import sisudoc.outputs.io_out.sqlite : sqliteFailureTally;
+ if (sqliteFailureTally() > 0) {
+ stderr.writefln(
+ "~ run FAILED ~ %s sqlite statement(s) failed, db not written as expected",
+ sqliteFailureTally(),
+ );
+ import core.stdc.stdlib : exit;
+ exit(1);
+ }
+ }
}
#+END_SRC