feat(schema): implement SQLite table semantics #2

Open
toad wants to merge 6 commits from feat/sqlite-table-semantics into main
Member

OpenSpec

Change: sqlite-table-semantics (spec-driven). All 13/13 tasks complete; six requirements covered.

Scope

  • Canonical persisted DDL resolves callback CHECKs and excludes runtime mappings; changed metadata converges, unchanged metadata stays put.
  • Typed BINARY/NOCASE/RTRIM collations, ANY, STRICT/WITHOUT ROWID, composite and single-column foreign keys with actions/deferral, named constraints and SQLite-valid DDL conflict policies.
  • Validate invalid SQLite combinations and empty table constraints before DDL. Preserve column refs that collide with table controls via symbol-keyed tableControls.
  • Rebuild tables atomically with data, dependent views/indexes and tracking records. Bun uses verified FK-safe transaction; D1-style connections refuse incoming FK references before destructive SQL while safe native ADD remains available.
  • Update README and authoritative source plan; add compile-time, generated SQL and in-memory migration coverage.

Checkpoints

  • 23b8d4a Canonical persisted CHECK expressions
  • 81456bf Dependency- and foreign-key-safe rebuilds
  • d1b3c84 Typed SQLite table semantics, tests and documentation
  • 175430a Reject empty constraints and repair verification findings
  • bddd99c Preserve column refs named after table controls
  • 7baf2c4 Preserve Bun transaction receiver; add root and nested regression test

Verification

  • openspec validate sqlite-table-semantics: passed; 13/13 tasks complete.
  • bun run check: passed, including five TypeScript project references.
  • bun run lint: 0 errors, 14 pre-existing warnings.
  • bun test: 83 passed, 0 failed. Focused suite and independent SQLite probe also passed.
  • Branch diff against main passes git diff --check; all checkpoints pushed.

D1 behavior tested using D1-style connection backed by Bun SQLite; no live D1 claim.

## OpenSpec Change: `sqlite-table-semantics` (spec-driven). All 13/13 tasks complete; six requirements covered. ## Scope - Canonical persisted DDL resolves callback CHECKs and excludes runtime mappings; changed metadata converges, unchanged metadata stays put. - Typed BINARY/NOCASE/RTRIM collations, ANY, STRICT/WITHOUT ROWID, composite and single-column foreign keys with actions/deferral, named constraints and SQLite-valid DDL conflict policies. - Validate invalid SQLite combinations and empty table constraints before DDL. Preserve column refs that collide with table controls via symbol-keyed `tableControls`. - Rebuild tables atomically with data, dependent views/indexes and tracking records. Bun uses verified FK-safe transaction; D1-style connections refuse incoming FK references before destructive SQL while safe native ADD remains available. - Update README and authoritative source plan; add compile-time, generated SQL and in-memory migration coverage. ## Checkpoints - `23b8d4a` Canonical persisted CHECK expressions - `81456bf` Dependency- and foreign-key-safe rebuilds - `d1b3c84` Typed SQLite table semantics, tests and documentation - `175430a` Reject empty constraints and repair verification findings - `bddd99c` Preserve column refs named after table controls - `7baf2c4` Preserve Bun transaction receiver; add root and nested regression test ## Verification - `openspec validate sqlite-table-semantics`: passed; 13/13 tasks complete. - `bun run check`: passed, including five TypeScript project references. - `bun run lint`: 0 errors, 14 pre-existing warnings. - `bun test`: 83 passed, 0 failed. Focused suite and independent SQLite probe also passed. - Branch diff against `main` passes `git diff --check`; all checkpoints pushed. D1 behavior tested using D1-style connection backed by Bun SQLite; no live D1 claim.
feat(schema): canonicalize persisted check expressions
All checks were successful
Checks / checks (pull_request) Successful in 7s
Checks / release (pull_request) Has been skipped
23b8d4abfa
fix(migration): rebuild tables without losing dependencies
All checks were successful
Checks / checks (pull_request) Successful in 7s
Checks / release (pull_request) Has been skipped
81456bf298
feat(schema): support SQLite table semantics
All checks were successful
Checks / checks (pull_request) Successful in 6s
Checks / release (pull_request) Has been skipped
d1b3c84ac6
fix(schema): reject empty table constraints
All checks were successful
Checks / checks (pull_request) Successful in 10s
Checks / release (pull_request) Has been skipped
175430ac43
fix(schema): preserve column refs named after table controls
All checks were successful
Checks / checks (pull_request) Successful in 7s
Checks / release (pull_request) Has been skipped
bddd99c2b4
fix(api): preserve transaction connection context
All checks were successful
Checks / checks (pull_request) Successful in 7s
Checks / release (pull_request) Has been skipped
7baf2c409a
All checks were successful
Checks / checks (pull_request) Successful in 7s
Checks / release (pull_request) Has been skipped
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feat/sqlite-table-semantics:feat/sqlite-table-semantics
git switch feat/sqlite-table-semantics

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff feat/sqlite-table-semantics
git switch feat/sqlite-table-semantics
git rebase main
git switch main
git merge --ff-only feat/sqlite-table-semantics
git switch feat/sqlite-table-semantics
git rebase main
git switch main
git merge --no-ff feat/sqlite-table-semantics
git switch main
git merge --squash feat/sqlite-table-semantics
git switch main
git merge --ff-only feat/sqlite-table-semantics
git switch main
git merge feat/sqlite-table-semantics
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sigitex/outlaw!2
No description provided.