feat(schema): support typed SQLite virtual tables #7

Open
toad wants to merge 3 commits from feat/sqlite-virtual-tables into feat/sqlite-triggers
Member

OpenSpec

Change: sqlite-virtual-tables (spec-driven). Proposal, design, capability spec and checklist reviewed; 9/9 tasks complete. Strict OpenSpec validation passes. OpenSpec artifacts remain local because repository ignores openspec/.

Scope

  • Public virtual-table builder and CREATE VIRTUAL TABLE generator persist only name, module and ordered arguments. Explicitly declared query columns, types and mappings stay out of persisted DDL.
  • Typed SELECT accessors support projection, filtering, aliases and joins with tables, views and subqueries; ordinary typed INSERT/UPDATE/DELETE is not promised.
  • Cowboy creates or restores missing virtual tables, preserves unchanged DDL and query-only changes, refuses automatic module/argument changes with manual-migration guidance, retains omitted storage/tracking, and requires an explicit destructive drop hint for omitted tracked virtual tables. Repeated hints are safe; SQLite owns shadow tables.
  • README and authoritative docs/plans/full-sqlite.md cover supported query/write boundaries, FTS5/R-Tree availability, trusted raw SQL arguments, data loss on removal, and no live D1 verification.

Checkpoints

  • 7216857 typed schema/query integration, migration policy and focused execution tests.
  • e193f73 README and authoritative plan.
  • 83320d6 idempotent drop, missing-table restoration, explicit module skips, regression tests and guidance.
    All checkpoints pushed to feat/sqlite-virtual-tables; this PR targets feat/sqlite-triggers. No unrelated stacked commits attributed to this change.

Verification

  • openspec validate sqlite-virtual-tables --strict passed; apply status 9/9.
  • bun run check passed; all five no-emit TypeScript project checks passed.
  • Focused virtual-table, trigger and join suites: 100 passed, 0 failed; full bun test: 125 passed, 0 failed (391 assertions).
  • bun run lint: 0 errors, 14 pre-existing warnings.
  • Lifecycle and query regression coverage includes repeat startup after drop hint, missing-table restoration, module-unavailable skips, view/subquery joins and SQLite invalid-column errors.
  • Reviewed branch-only diff against feat/sqlite-triggers, documentation, regression risk and trusted-SQL guidance; no exposed secrets. git diff --check passed. Working tree clean; local and remote SHA match.

No live Cloudflare D1 virtual-table module execution claimed.

## OpenSpec Change: `sqlite-virtual-tables` (spec-driven). Proposal, design, capability spec and checklist reviewed; 9/9 tasks complete. Strict OpenSpec validation passes. OpenSpec artifacts remain local because repository ignores `openspec/`. ## Scope - Public virtual-table builder and CREATE VIRTUAL TABLE generator persist only name, module and ordered arguments. Explicitly declared query columns, types and mappings stay out of persisted DDL. - Typed SELECT accessors support projection, filtering, aliases and joins with tables, views and subqueries; ordinary typed INSERT/UPDATE/DELETE is not promised. - Cowboy creates or restores missing virtual tables, preserves unchanged DDL and query-only changes, refuses automatic module/argument changes with manual-migration guidance, retains omitted storage/tracking, and requires an explicit destructive drop hint for omitted tracked virtual tables. Repeated hints are safe; SQLite owns shadow tables. - README and authoritative `docs/plans/full-sqlite.md` cover supported query/write boundaries, FTS5/R-Tree availability, trusted raw SQL arguments, data loss on removal, and no live D1 verification. ## Checkpoints - `7216857` typed schema/query integration, migration policy and focused execution tests. - `e193f73` README and authoritative plan. - `83320d6` idempotent drop, missing-table restoration, explicit module skips, regression tests and guidance. All checkpoints pushed to `feat/sqlite-virtual-tables`; this PR targets `feat/sqlite-triggers`. No unrelated stacked commits attributed to this change. ## Verification - `openspec validate sqlite-virtual-tables --strict` passed; apply status 9/9. - `bun run check` passed; all five no-emit TypeScript project checks passed. - Focused virtual-table, trigger and join suites: 100 passed, 0 failed; full `bun test`: 125 passed, 0 failed (391 assertions). - `bun run lint`: 0 errors, 14 pre-existing warnings. - Lifecycle and query regression coverage includes repeat startup after drop hint, missing-table restoration, module-unavailable skips, view/subquery joins and SQLite invalid-column errors. - Reviewed branch-only diff against `feat/sqlite-triggers`, documentation, regression risk and trusted-SQL guidance; no exposed secrets. `git diff --check` passed. Working tree clean; local and remote SHA match. No live Cloudflare D1 virtual-table module execution claimed.
feat(schema): support typed SQLite virtual tables
All checks were successful
Checks / checks (pull_request) Successful in 7s
Checks / release (pull_request) Has been skipped
7216857da3
docs: describe managed SQLite virtual tables
All checks were successful
Checks / checks (pull_request) Successful in 7s
Checks / release (pull_request) Has been skipped
e193f73b09
fix(migration): restore and safely remove virtual tables
All checks were successful
Checks / checks (pull_request) Successful in 7s
Checks / release (pull_request) Has been skipped
83320d6cec
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-virtual-tables:feat/sqlite-virtual-tables
git switch feat/sqlite-virtual-tables

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