Replies: 4 comments 6 replies
-
Hello @mallman, I have no direct experience with the session extension, but it was involved in a recent discussion: #1457. We learned that sqlite3changeset_apply() performs changes that are not visible to the built-in GRDB database observation features. That's because observation requires statements that are compiled by GRDB, when the session extension does not. This led to #1460, which allows the application developer to explicitly declare that some changes were applied. The original reporter, @gerdemb, did not need fine-grained change reporting, so a generic Maybe you can both share your experiences with the session extension? My only contribution so far would be: take care that database observation, a very important feature of the library, might make get in the way of a smooth integration in the main library. |
Beta Was this translation helpful? Give feedback.
-
@mallman I wrote an experimental Swift package SQLiteChangesetSync that allows for the offline-first synchronization of SQLite databases that works by leveraging the SQLite Session Extension. If I understand your use case correctly, it sounds like you want to get a changeset for the changes made to a database, and then be able to inspect the contents of that changeset, but without applying it? Conceptually, changesets work like the UNIX command patch. You call Anyway, It's been a while since I looked at my project, but I think you can use https://github.com/gerdemb/SQLiteChangesetSync/blob/main/Sources/SQLiteChangesetSync/SQLiteSession.swift to capture change set data and into a ChangsetData object then access the
Is that true? I found that I could use the session extension in the version of SQLite I had in macOS as well as inside the iOS simulators used with Xcode. |
Beta Was this translation helpful? Give feedback.
-
At this point it looks like I won't be using the SQLite session extension after all, however a GRDB value observer that (efficiently) provides a diff (say, transaction scoped) instead of a new query result could be a valuable addition to the API. I'm working with an @groue I would suggest you consider providing this kind of functionality directly with GRDB. It would be a major feature addition. I'm using Swift's powerful |
Beta Was this translation helpful? Give feedback.
-
I think this convo has run its course. I'm going to close it now. |
Beta Was this translation helpful? Give feedback.
-
I'm exploring the use of SQLite's session extension in my app. I see GRDB does not have an API for it. I may write my own. Is this something you've explored implementing? Does it interest you as a potential part of GRDB?
Beta Was this translation helpful? Give feedback.
All reactions