-
-
Notifications
You must be signed in to change notification settings - Fork 800
Persistable Database Views #1810
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
Merged
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
groue
commented
Sep 8, 2025
56741ee to
3e1a711
Compare
|
Thanks for the awesome work @groue! I've tested this for PowerSync on our end with some basic queries. We're still ironing out some unrelated kinks in our PowerSync integration, but so far this works perfectly for us. |
Owner
Author
|
Thank you for the good news, @stevensJourney! 👍 Unless you tell me otherwise, I'll merge this PR shortly! |
This is also a big cleanup opportunity. We need public schema identifiers in order to support the customization of schema introspection.
This method is necessary for the customization of schema introspection: it must be possible to fallback on the primitive SQLite schema introspection when needed.
Database.changesCount calls sqlite3_changes(), whose documentation says: > https://sqlite.org/c3ref/changes.html > Changes to a view that are intercepted by INSTEAD OF triggers are not counted. Since we want to support INSTEAD OF triggers well, so that record types can be based on views, we switch to sqlite3_total_changes().
When GRDB eventually adds methods to the DatabaseSchemaSource protocol, our chained schema source will implement chaining on those new methods. When users write their own custom chaining schema source, the compiler will not tell them that they have to chain the new methods when they upgrade GRDB. The built-in (and correct) implementation of chaining helps avoiding this scenario.
3e1a711 to
9ef5e2c
Compare
Owner
Author
|
⛵ Shipped in v7.7.0! |
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.
This pull request enhances support for record types that target a database view. It is now possible to instruct GRDB about the primary key of a view, and this unlocks both reads and writes that used to throw a database error.
See View Records.
Original discussion: #1809