diff options
| author | Ralph Amissah <ralph.amissah@gmail.com> | 2026-09-14 10:44:22 -0400 |
|---|---|---|
| committer | Ralph Amissah <ralph.amissah@gmail.com> | 2026-09-14 12:30:43 -0400 |
| commit | cd8a98300440418d31ac9222a53c25602cc100de (patch) | |
| tree | 2ff756228227a3751b9499f58c8d58d39b652209 /shell.nix | |
| parent | flake.nix visit (diff) | |
search: allow a db path from the environment
Allow a db path from the environment, and refuse what it cannot read
Three changes related to opening the database:
- provide an environment override for the db path: SPINE_SEARCH_DB_PATH
overrides the compiled-in db_sqlite_path, beside the other
environment.get calls. Path was the one setting without an override,
(SERVER_NAME, REQUEST_SCHEME, SCRIPT_NAME, QUERY_STRING could come
from the environment). This adds consistency and makes testing the
search form database builds easier (as it no longer requires
rebuilding the binary with a patched configuration for readily
accessible db path)
- selected_db is required to be a plain filename within the configured
directory, the database is opened read only, and a database that is
not there is named rather than created.
- The form now reads PRAGMA user_version, as stamped by spine, and
refuses a database built to another schema version, naming both
versions and the two commands that rebuild it. A database carrying
neither of the tables it joins is refused the same way.
sqlite_db_schema_version_- is expected and has to be in sync/step with
the sqlite_db_schema_version in
sisudoc-spine src/sisudoc/outputs/io_out/sqlite.d; the two tests added
there under test/ check that they agree.
(assisted by Claude-Code)
Diffstat (limited to 'shell.nix')
0 files changed, 0 insertions, 0 deletions
