Repository navigation
Preserve SQLite view and trigger dependencies during rebuilds - #220
Merged
Merged
Conversation
This was referenced Nov 22, 2026
jogibear9988
commented
Nov 22, 2026
jogibear9988
left a comment
Member
Author
There was a problem hiding this comment.
Reviewed the current head. The actionable findings are inline.
jogibear9988
force-pushed
the
codex/214-sqlite-view-rebuild
branch
from
November 22, 2026 08:39
c2fd8a9 to
10990a5
Compare
jogibear9988
commented
Nov 22, 2026
jogibear9988
left a comment
Member
Author
There was a problem hiding this comment.
Follow-up review of the current head. One actionable finding is inline.
jogibear9988
force-pushed
the
codex/214-sqlite-view-rebuild
branch
from
November 22, 2026 10:19
10990a5 to
72221b4
Compare
jogibear9988
force-pushed
the
codex/214-sqlite-view-rebuild
branch
from
November 22, 2026 10:27
72221b4 to
d7a30d5
Compare
jogibear9988
force-pushed
the
codex/214-sqlite-view-rebuild
branch
from
November 22, 2026 10:33
d7a30d5 to
2382e4b
Compare
jogibear9988
commented
Nov 22, 2026
jogibear9988
left a comment
Member
Author
There was a problem hiding this comment.
Follow-up review of the current head. New findings are inline.
jogibear9988
force-pushed
the
codex/214-sqlite-view-rebuild
branch
from
November 22, 2026 11:14
2382e4b to
d3b3443
Compare
jogibear9988
force-pushed
the
codex/214-sqlite-view-rebuild
branch
from
November 22, 2026 11:22
d3b3443 to
e05f6ed
Compare
jogibear9988
force-pushed
the
codex/214-sqlite-view-rebuild
branch
from
November 22, 2026 11:30
e05f6ed to
9875b30
Compare
jogibear9988
commented
Nov 22, 2026
jogibear9988
left a comment
Member
Author
There was a problem hiding this comment.
One new SQLite rebuild regression is inline.
jogibear9988
force-pushed
the
codex/214-sqlite-view-rebuild
branch
from
November 22, 2026 13:44
9875b30 to
62eee9b
Compare
jogibear9988
commented
Nov 22, 2026
jogibear9988
left a comment
Member
Author
There was a problem hiding this comment.
One compatibility regression in the new strict view validation is inline.
jogibear9988
force-pushed
the
codex/214-sqlite-view-rebuild
branch
from
November 22, 2026 14:37
62eee9b to
78722da
Compare
jogibear9988
force-pushed
the
codex/214-sqlite-view-rebuild
branch
4 times, most recently
from
November 22, 2026 15:37
ed806aa to
cdc27cf
Compare
jogibear9988
force-pushed
the
codex/214-sqlite-view-rebuild
branch
from
November 22, 2026 15:37
cdc27cf to
39a94af
Compare
Base automatically changed from
codex/213-projected-data-migrations
to
master
November 22, 2026 15:37
jogibear9988
force-pushed
the
codex/214-sqlite-view-rebuild
branch
from
November 22, 2026 15:37
39a94af to
51decce
Compare
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.
SQLite reconstruction must preserve executable views and triggers while the original table is briefly absent. Rebuilds now preserve their definitions through copy/rename, replay TEMP triggers with their original target schema, and roll back failures using a savepoint, including within an outer transaction.
Every view and INSERT/UPDATE/DELETE trigger program that prepared before reconstruction must still prepare afterward. EXPLAIN compiles trigger programs without executing their writes or bodies, covering external triggers that depend on the rebuilt table through views, UPDATE OF columns, implicit rowid aliases, and INSTEAD OF triggers on views. Pre-existing invalid programs remain untouched. Literal table names in unrelated triggers no longer cause false dependency matches.
For schema-changing rebuilds, SQLite's compiled table/index b-tree bindings identify the dependent views and trigger programs, including indirect dependencies, covering indexes and attached databases. Only those dependencies are also validated with double-quoted string fallback disabled. This prevents removed quoted columns becoming literals while allowing unrelated legacy views to retain their behavior. The original DQS_DML setting is restored on success and failure. Dependent objects must use single quotes for string literals; Microsoft.Data.Sqlite and System.Data.SQLite expose the required setting, and other drivers must already disable DQS_DML.
Validation: 16 existing preservation cases plus 29 binding/program cases on each SQLite ADO.NET driver. The latter cover direct/transitive/TEMP/attached views and triggers, generated columns, all trigger events, rowid aliases, unrelated literals, valid surviving dependencies, pre-existing invalid triggers, outer rollback and setting restoration. Local combined DTO/feature branches build and pass 927 unit tests and 177 focused SQLite tests. GitHub Actions rechecks all database suites on every updated PR.
The guard/audit exports inherited from #215/#216 also validate SQLite watched columns against queued/renamed definitions or supplied existing-table metadata, and explicitly reject unverified exports.
Stacked on #219, with #222 rebased on this PR. This reconstruction path is specific to SQLite; native rename/drop remains responsible for supported dependency rewrites.
Closes #214.