Feat/tier6 sqlite backend - #10
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.