-
Notifications
You must be signed in to change notification settings - Fork 5
feat: add initial types/logic to observe SQLite #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
jjhafer
merged 5 commits into
silvermine:master
from
pmorris-dev:sqlite-observer-phase-1
Feb 6, 2026
Merged
feat: add initial types/logic to observe SQLite #32
jjhafer
merged 5 commits into
silvermine:master
from
pmorris-dev:sqlite-observer-phase-1
Feb 6, 2026
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
- We need a clean and reliable way to know when a SQLite
database has been updated (written to). SQLite provides
hooks which describe changes that have been committed
- Which table
- Which rowid
- Old and new values when applicable
- Phase 1 includes:
- The hooks part of the library which is the code that
communicates with the SQLite C ABI. We register for:
- Preupdate hook
- Commit hook (fires for implicit and explicit tx commits
- Rollback hook
- The `TableChange` and `ColumnValue` types
and helpers
- The broker API which takes subscriptions and manages
the buffer of change events
- Details about what's to come in the next two phases,
in the README
- Use of this feature requires that we bundle a version of
SQLite which supports these hooks, which we planned
to do anyway.
jjhafer
requested changes
Feb 5, 2026
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pmorris-dev Looks good, just a couple minor questions.
- It's the PK that the user really needs and that might not be the rowid - If the table schema includes WITHOUT ROWID, the first/only column making up the PK is returned. That's hokey. So now we return None for rowid in that case - Needed to add some introspection logic to find which column(s) make up the PK and whether the table was created using WITHOUT ROWID
4a929af to
060455c
Compare
jjhafer
requested changes
Feb 6, 2026
- We need a clean and reliable way to know when a SQLite
database has been updated (written to). SQLite provides
hooks which describe changes that have been committed
- Which table
- Which rowid
- Old and new values when applicable
- Phase 1 includes:
- The hooks part of the library which is the code that
communicates with the SQLite C ABI. We register for:
- Preupdate hook
- Commit hook (fires for implicit and explicit tx commits
- Rollback hook
- The `TableChange` and `ColumnValue` types
and helpers
- The broker API which takes subscriptions and manages
the buffer of change events
- Details about what's to come in the next two phases,
in the README
- Use of this feature requires that we bundle a version of
SQLite which supports these hooks, which we planned
to do anyway.
- It's the PK that the user really needs and that might not be the rowid - If the table schema includes WITHOUT ROWID, the first/only column making up the PK is returned. That's hokey. So now we return None for rowid in that case - Needed to add some introspection logic to find which column(s) make up the PK and whether the table was created using WITHOUT ROWID
…dev/tauri-plugin-sqlite into sqlite-observer-phase-1
jjhafer
approved these changes
Feb 6, 2026
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.
TableChangeandColumnValuetypes and helpers