Repository navigation
Fix FTS4 triggers for updates and deletes - #923
Open
Muguett-DBY wants to merge 3 commits into
Open
Muguett-DBY wants to merge 3 commits into
Muguett-DBY wants to merge 3 commits into
Conversation
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.
Fixes #922.
FTS4 needs the old content row to be available when it removes an index entry. This uses BEFORE DELETE and BEFORE UPDATE triggers for that removal, followed by an AFTER UPDATE trigger to index the new values. The existing FTS5 triggers are unchanged.
replace=Truerecreates older FTS4 trigger sets, anddisable_fts()now also removes DELETE-based triggers while handling quoted names and SQL wildcard characters safely.Testing:
mypy sqlite_utils testspassed with the project configuration (mypy 2.4.1).flake8check passed (flake8 7.5.0).I used Codex to help investigate and implement this fix, and reviewed the changes and test results.