feat(schema): support managed SQLite triggers #6

Open
toad wants to merge 3 commits from feat/sqlite-triggers into feat/sqlite-generated-columns
Member

OpenSpec

Change: sqlite-triggers (spec-driven). Proposal, design, capability spec and tasks reviewed; all 7/7 tasks complete. OpenSpec artifacts remain local because repository ignores openspec/.

Scope

  • Generalize schema member collection for managed triggers alongside tables, views and indexes.
  • Persist deterministic trigger metadata for timing, event, optional UPDATE OF and WHEN, and ordered SQL body; expose fluent public builder and executable CREATE TRIGGER generator.
  • Cowboy replaces changed triggers, removes stale tracked triggers, restores unchanged triggers lost to table/view rebuilds after dependencies converge, and skips surviving unchanged triggers on restart.
  • README and authoritative docs/plans/full-sqlite.md describe API, migration behavior, trusted raw SQL, and Bun/D1 verification limits.

Checkpoints

  • 4251843 schema model, public trigger builder, generator.
  • 5160cd8 migration convergence and Bun lifecycle tests.
  • 0cecb72 documentation and source plan.
    All commits pushed to feat/sqlite-triggers; PR targets feat/sqlite-generated-columns.

Verification

  • openspec validate sqlite-triggers --strict passed; apply status 7/7.
  • Focused trigger and affected stacked-change tests passed; full bun test: 119 passed, 0 failed (354 assertions).
  • Read-only source and test type checks passed; bun run check passed during implementation.
  • bun run lint: 0 errors, 14 pre-existing warnings.
  • View-only trigger replacement and generated-column rebuild with trigger restoration probes passed.
  • Reviewed only diff against feat/sqlite-generated-columns, including design, documentation, regression risk and trusted raw-SQL handling; git diff --check passed. Working tree clean and local/remote HEAD match.

No live Cloudflare D1 trigger execution is claimed.

## OpenSpec Change: `sqlite-triggers` (spec-driven). Proposal, design, capability spec and tasks reviewed; all 7/7 tasks complete. OpenSpec artifacts remain local because repository ignores `openspec/`. ## Scope - Generalize schema member collection for managed triggers alongside tables, views and indexes. - Persist deterministic trigger metadata for timing, event, optional UPDATE OF and WHEN, and ordered SQL body; expose fluent public builder and executable CREATE TRIGGER generator. - Cowboy replaces changed triggers, removes stale tracked triggers, restores unchanged triggers lost to table/view rebuilds after dependencies converge, and skips surviving unchanged triggers on restart. - README and authoritative `docs/plans/full-sqlite.md` describe API, migration behavior, trusted raw SQL, and Bun/D1 verification limits. ## Checkpoints - `4251843` schema model, public trigger builder, generator. - `5160cd8` migration convergence and Bun lifecycle tests. - `0cecb72` documentation and source plan. All commits pushed to `feat/sqlite-triggers`; PR targets `feat/sqlite-generated-columns`. ## Verification - `openspec validate sqlite-triggers --strict` passed; apply status 7/7. - Focused trigger and affected stacked-change tests passed; full `bun test`: 119 passed, 0 failed (354 assertions). - Read-only source and test type checks passed; `bun run check` passed during implementation. - `bun run lint`: 0 errors, 14 pre-existing warnings. - View-only trigger replacement and generated-column rebuild with trigger restoration probes passed. - Reviewed only diff against `feat/sqlite-generated-columns`, including design, documentation, regression risk and trusted raw-SQL handling; `git diff --check` passed. Working tree clean and local/remote HEAD match. No live Cloudflare D1 trigger execution is claimed.
feat(schema): add SQLite trigger builder and generator
All checks were successful
Checks / checks (pull_request) Successful in 7s
Checks / release (pull_request) Has been skipped
425184379c
feat(migration): converge managed SQLite triggers
All checks were successful
Checks / checks (pull_request) Successful in 6s
Checks / release (pull_request) Has been skipped
5160cd8bf9
docs: describe managed SQLite triggers
All checks were successful
Checks / checks (pull_request) Successful in 7s
Checks / release (pull_request) Has been skipped
0cecb72e55
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-triggers:feat/sqlite-triggers
git switch feat/sqlite-triggers

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