sqlite-android icon indicating copy to clipboard operation
sqlite-android copied to clipboard

Open to a PR to support sqlite3_update_hook, sqlite3_commit_hook, sqlite3_rollback_hook?

Open hborders opened this issue 1 year ago • 2 comments

I'd like to add support for sqlite3_update_hook and sqlite3_commit_hook and sqlite3_rollback_hook, and ideally, I'd like to do so as part of this project. Do you have any contribution guidelines?

I think implementing the sqlite3_update_hook API is most important because it could avoid a re-query when dependent data changes. Similar APIs exist in SqlBrite and SqlDelight Query (which requires users to maintain their own dependencies outside sqlite, and which notifies outside sqlite after the transaction completes in Transacter), but they always requery all data. Instead, a sqlite3_update_hook could allow a client to requery only the data that changed rather than the entire data set.

If including API that doesn't exist either directly or in spirit within Android or AndroidX is not within the bounds of this project, do you have any advice for how to add sqlite_*_hook support to a project consuming requery/sqlite-android?

Thanks!

hborders avatar Nov 21 '23 05:11 hborders

Hi yes that makes sense to me since its an optional hook, feel free to open a PR. I think this can be implemented similarly to SQLiteFunction.

npurushe avatar Dec 04 '23 09:12 npurushe

Hello,

We were also looking to have the update hook supported. I opened a PR here 194.

jdicami avatar Jul 29 '24 21:07 jdicami