refactor(server): drop dead snapshotAll; quote identifiers in trigger DDL#7
Open
grrowl wants to merge 1 commit into
Open
refactor(server): drop dead snapshotAll; quote identifiers in trigger DDL#7grrowl wants to merge 1 commit into
grrowl wants to merge 1 commit into
Conversation
… 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Executes plan 006 from the advisor audit. Smallest of the set: −12/+12 in
src/server/changes.ts.What
snapshotAll— zero callers anywhere (the real snapshot path goes throughcompileSubsetQuery), and it was one of the two unquoted-identifier interpolation sites.CREATE TRIGGERstatements (trigger name,ONtable,NEW./OLD.pk); the'${tbl}'value literal stays single-quoted. The registryIDENTregex remains the real gate — quoting is consistency + defense in depth, matchingsql-compiler.tsandensureTriggers' DROP.hydrateRowsdeliberately untouched — owned by the plan-004 PR.Verification
No new tests by design:
cdc,compaction,schema-evolution(idempotency) andensure-triggers(reaping set-diff vssqlite_master) pin every failure mode; all green on the reviewer's independent re-run.🤖 Generated with Claude Code