Skip to content

refactor(server): drop dead snapshotAll; quote identifiers in trigger DDL#7

Open
grrowl wants to merge 1 commit into
feat/ssrfrom
advisor/006-dead-code-identifier-quoting
Open

refactor(server): drop dead snapshotAll; quote identifiers in trigger DDL#7
grrowl wants to merge 1 commit into
feat/ssrfrom
advisor/006-dead-code-identifier-quoting

Conversation

@grrowl

@grrowl grrowl commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Executes plan 006 from the advisor audit. Smallest of the set: −12/+12 in src/server/changes.ts.

What

  • Delete snapshotAll — zero callers anywhere (the real snapshot path goes through compileSubsetQuery), and it was one of the two unquoted-identifier interpolation sites.
  • Double-quote every identifier position in the three CDC CREATE TRIGGER statements (trigger name, ON table, NEW./OLD. pk); the '${tbl}' value literal stays single-quoted. The registry IDENT regex remains the real gate — quoting is consistency + defense in depth, matching sql-compiler.ts and ensureTriggers' DROP.

hydrateRows deliberately untouched — owned by the plan-004 PR.

Verification

No new tests by design: cdc, compaction, schema-evolution (idempotency) and ensure-triggers (reaping set-diff vs sqlite_master) pin every failure mode; all green on the reviewer's independent re-run.

🤖 Generated with Claude Code

… DDL

`snapshotAll` had zero callers in src/ or tests/ and was never exported
from src/server/index.ts — deleting it removes an unquoted table-name
interpolation that modelled the wrong habit.

`installTriggers` now double-quotes every identifier position (trigger
name, table name, pk column) for consistency with sql-compiler.ts and
ensureTriggers' existing DROP. The regex gate (assertValidCollection)
remains the real safety net; quoting just makes the helper safe even if
a future caller bypasses the registry.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant