feat(schema): support generated SQLite columns #5

Open
toad wants to merge 4 commits from feat/sqlite-generated-columns into feat/sqlite-advanced-indexes
Member

OpenSpec

Change: sqlite-generated-columns (spec-driven). Proposal, design, spec reviewed; all 8/8 tasks complete. openspec validate sqlite-generated-columns passed.

Scope

  • Canonical SQL expressions plus VIRTUAL/STORED metadata; SQLite-valid DDL and pre-execution DEFAULT/PRIMARY KEY rejection.
  • Generated values stay in SELECT/RETURNING, not INSERT/UPDATE, fixture/template inputs, seeds, or rebuild copies.
  • Cowboy detects expression/storage changes, recomputes generated values in permitted rebuilds, preserves orphan protection for discarded writable data, and avoids direct ADD for STORED columns.
  • Fixture guards reject generated keys in single, mixed and union-typed rows and templates; runtime guards reject untyped generated fixture input.
  • README and authoritative docs/plans/full-sqlite.md document behavior, migration limits and SQLite/Bun/D1 support.

Checkpoints

  • 6f4cfa9 implement generated columns and focused tests.
  • 1e79eb3 document behavior and complete OpenSpec artifacts.
  • 7bf944f reject generated values in fixture inputs.
  • f554bbf reject generated values in mixed fixture rows.
    All four commits pushed to feat/sqlite-generated-columns.

Verification

  • Five TypeScript configurations passed no-emit checks; direct build skipped because it writes files.
  • Focused Bun tests: 91 passed. Full suite, including stacked-change tests: 116 passed, 0 failed (336 assertions).
  • Independent TypeScript/runtime probes: generated values rejected in single and mixed fixture rows and templates; valid rows accepted.
  • Generated-column rebuild retained advanced index; D1-style connection refused referenced-parent rebuild. No live D1 claim.
  • bun run lint: 0 errors, 14 existing-pattern warnings. Strict OpenSpec validation passed; tasks 8/8 complete.
  • Change-only diff against feat/sqlite-advanced-indexes: whitespace check and added-secret scan passed. Working tree clean, remote SHA matches local HEAD.
## OpenSpec Change: `sqlite-generated-columns` (spec-driven). Proposal, design, spec reviewed; all 8/8 tasks complete. `openspec validate sqlite-generated-columns` passed. ## Scope - Canonical SQL expressions plus VIRTUAL/STORED metadata; SQLite-valid DDL and pre-execution DEFAULT/PRIMARY KEY rejection. - Generated values stay in SELECT/RETURNING, not INSERT/UPDATE, fixture/template inputs, seeds, or rebuild copies. - Cowboy detects expression/storage changes, recomputes generated values in permitted rebuilds, preserves orphan protection for discarded writable data, and avoids direct ADD for STORED columns. - Fixture guards reject generated keys in single, mixed and union-typed rows and templates; runtime guards reject untyped generated fixture input. - README and authoritative `docs/plans/full-sqlite.md` document behavior, migration limits and SQLite/Bun/D1 support. ## Checkpoints - `6f4cfa9` implement generated columns and focused tests. - `1e79eb3` document behavior and complete OpenSpec artifacts. - `7bf944f` reject generated values in fixture inputs. - `f554bbf` reject generated values in mixed fixture rows. All four commits pushed to `feat/sqlite-generated-columns`. ## Verification - Five TypeScript configurations passed no-emit checks; direct build skipped because it writes files. - Focused Bun tests: 91 passed. Full suite, including stacked-change tests: 116 passed, 0 failed (336 assertions). - Independent TypeScript/runtime probes: generated values rejected in single and mixed fixture rows and templates; valid rows accepted. - Generated-column rebuild retained advanced index; D1-style connection refused referenced-parent rebuild. No live D1 claim. - `bun run lint`: 0 errors, 14 existing-pattern warnings. Strict OpenSpec validation passed; tasks 8/8 complete. - Change-only diff against `feat/sqlite-advanced-indexes`: whitespace check and added-secret scan passed. Working tree clean, remote SHA matches local HEAD.
feat(schema): support generated SQLite columns
All checks were successful
Checks / checks (pull_request) Successful in 7s
Checks / release (pull_request) Has been skipped
6f4cfa99b4
docs: document generated columns and complete OpenSpec change
All checks were successful
Checks / checks (pull_request) Successful in 6s
Checks / release (pull_request) Has been skipped
1e79eb317a
fix(schema): reject generated fixture inputs
All checks were successful
Checks / checks (pull_request) Successful in 7s
Checks / release (pull_request) Has been skipped
7bf944fe01
fix(schema): reject generated columns in mixed fixture rows
All checks were successful
Checks / checks (pull_request) Successful in 6s
Checks / release (pull_request) Has been skipped
f554bbf246
All checks were successful
Checks / checks (pull_request) Successful in 6s
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-generated-columns:feat/sqlite-generated-columns
git switch feat/sqlite-generated-columns

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 feat/sqlite-advanced-indexes
git merge --no-ff feat/sqlite-generated-columns
git switch feat/sqlite-generated-columns
git rebase feat/sqlite-advanced-indexes
git switch feat/sqlite-advanced-indexes
git merge --ff-only feat/sqlite-generated-columns
git switch feat/sqlite-generated-columns
git rebase feat/sqlite-advanced-indexes
git switch feat/sqlite-advanced-indexes
git merge --no-ff feat/sqlite-generated-columns
git switch feat/sqlite-advanced-indexes
git merge --squash feat/sqlite-generated-columns
git switch feat/sqlite-advanced-indexes
git merge --ff-only feat/sqlite-generated-columns
git switch feat/sqlite-advanced-indexes
git merge feat/sqlite-generated-columns
git push origin feat/sqlite-advanced-indexes
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!5
No description provided.