Skip to content

Feat/tier6 sqlite backend - #10

Merged
raymondproguy merged 7 commits into
mainfrom
feat/tier6-sqlite-backend
Sep 17, 2026
Merged

raymondproguy merged 7 commits into
mainfrom
feat/tier6-sqlite-backend

Conversation

@raymondproguy

Copy link
Copy Markdown
Contributor

No description provided.

raymondproguy and others added 7 commits September 17, 2026 12:40
Cryden's own 0001-0007, verbatim, filenames kept rather than
renumbered into this repo's Postgres sequence (001-014) — a different
backend's schema, not a later chapter of the same history.

Reference material rather than what runs: cryden ships sqlite.Migrate,
which embeds its own copy, and main.go calls that. The README says so
at the point of use.

Co-Authored-By: Claude Code <noreply@anthropic.com>
DATABASE_URL or SQLITE_PATH, mutually exclusive, refusing both or
neither at startup. UsesSQLite is a method so there is one expression
of the rule rather than a field every caller re-derives.

Refusing both matters more than refusing neither: DATABASE_URL is what
the admin console needs and SQLITE_PATH is what the store wiring reads,
so preferring either silently would run a deployment on a backend its
configuration does not describe.

Co-Authored-By: Claude Code <noreply@anthropic.com>
The driver switch, cryden's own sqlite.Migrate at startup, and
CheckPragmas for the two load-bearing DSN pragmas. openStores returns
one struct from store/postgres or store/sqlite, so nothing downstream
knows which ran; this repo's own three tables stay Postgres-only and
are nil on SQLite.

Also fixes four stores that were still constructed as Postgres ones
after the switch, and skips the claims provider on SQLite — a nil
*PostgresStore through the interface is a non-nil interface holding a
nil pointer, and would panic on every login.

Co-Authored-By: Claude Code <noreply@anthropic.com>
AdminOnly is RequireAdmin on Postgres and a flat 501 on SQLite, and all
25 admin registrations go through the value it returns, so a route
added later inherits the answer instead of joining a list.

Not the existing 403: RequireAdmin depends on the operators table, so a
SQLite deployment has no operators and every caller — a legitimate one
included — would be told not_operator. 501 is a statement about the
deployment; 403 would have been a false one about the caller.

Co-Authored-By: Claude Code <noreply@anthropic.com>
A "The two backends" section: the switch, the 501 on the whole admin
console, what is inert on SQLite and what is not, the three pragmas,
and the fact that there is no migrate step. Plus the backup warning —
with WAL, a fresh deployment's schema sits in api.db-wal until
something checkpoints it, and nothing does on exit yet.

Co-Authored-By: Claude Code <noreply@anthropic.com>
First version here that is not additive in the usual sense: no path,
field or success response changed, but every /admin path can now answer
501. A reusable NotImplementedOnSQLite response referenced from all 25
admin operations, plus the info-section note explaining why it is 501
rather than the 403 a client might otherwise expect.

Co-Authored-By: Claude Code <noreply@anthropic.com>
CURRENT-STATE gains its Tier 6 section and a summary paragraph,
NEXT.md's section is marked done with the two things it did not
anticipate, and PROGRESS.md carries the session entry — including what
was verified end to end on SQLite and what still has no Postgres to run
against.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@raymondproguy
raymondproguy merged commit 5914203 into main Sep 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant