Repository navigation
Finish the schema while it's free: a schema version, bytes for hashes and batch IDs, STRICT tables, and a total decision order - #99
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…orybooks, and say each rule once Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
selfie-bot
approved these changes
Nov 28, 2026
selfie-bot
left a comment
Collaborator
There was a problem hiding this comment.
One spec nit inline: a refused store isn't left quite as it was.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
selfie-bot
approved these changes
Nov 28, 2026
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.
Follows #98, while no project's history is worth keeping. Each of these is cheap now and a migration later.
schema_versionholds one row, since real D1 refusesPRAGMA user_version.initStoreSchemachecks it in a request before setting anything up: a store with none of the tables gets version 1, and one at another version, or with tables and no version, throwsStoreSchemaErrorand is left as it was. The CLI reports an older store asold-store, as before, and a newer one as a newnewer-store.store/src/core/sql-bytes.ts, and the batch lookups share one fragment.STRICT, which can't be added to a table later without rebuilding it.newestFirst. Before, two stores given the same decisions in a different order could read a render differently. Both new tests fail without the fix.The reset. #98 hasn't been released, so one reset covers both.
OPERATIONS.md→ Resetting a project store now also dropsenvironments,stories,actors, andschema_version. Without that, a reset store would keep three non-STRICTtables and be refused for having tables and no version.Verified.
pnpm testpasses: store 658, CLI 532, UI 119, render 148, site 19.unhexwith one and two arguments,STRICTwithWITHOUT ROWID,STRICTrefusing a wrong type, and the version stamp'ssqlite_masterquery.~/.config/selfie/d1.envis gone.Left for later.
render_keys) have no version and aren'tSTRICT, so the CLI still treats a missing column asold-store.preflightcould check each project database's version before a release instead.🤖 Generated with Claude Code