CR-SQLite extension and SQLite commit/rollback/change hooks #1608
michaelmedellin
started this conversation in
General
Replies: 1 comment 7 replies
-
I think this could possibly be related to CRSQLite requiring exclusive use of the See here: vlcn-io/cr-sqlite#396 (comment) |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm running Custom GRDB with the CR-SQLite extension loaded successfully. One of the features of CR-SQLite is that it increments a database version on every transaction commit to the database. For some reason, this is not happening correctly with GRDB.
The only time the database version in crsqlite will increment is once the connection to the database is closed. A new connection will increase the db version and apply that same version to all transactions until the connection is closed again.
I've tried using both DatabaseQueue and DatabasePool without success. I did get the version to increment after manually checkpointing the database when using a DatabasePool connection. Checkpointing basically functioned identically to closing the connection as far as the db version behavior.
As a sanity check, I've tested CRSQLite extension with SQLite.swift using a similar set up in iOS and the version increments correct on each transaction (ex. an insertion to a table). This makes me think that the way GRDB handles connections somehow prevents the extension from realizing there are new transactions committed. Additionally, this also functions correctly when running the same extension from the SQLite CLI.
Any advice on how better to understand the details of GRDB's SQLite connections and any pointers to solutions would be greatly appreciated. I'm diving deep into the docs and haven't found a good lead quite yet. Thank you!
Beta Was this translation helpful? Give feedback.
All reactions