-
Notifications
You must be signed in to change notification settings - Fork 75
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
Any plans to implement sqlite3_update_hook? #61
Comments
It definitely should though! Are you defining the trigger in a I think update hooks could be a useful addition to this package regardless of Drift though. |
At the moment we're creating these triggers manually since they rely on a complex view that doesn't work in a |
I have implemented update hooks in 8d308c1.
If drift crashes or provides invalid analysis for a valid sqlite3 view, I'd love to take a look at that. If you're using @override
StreamQueryUpdateRules get streamUpdateRules {
return StreamQueryUpdateRules(
[
...super.streamUpdateRules.rules,
WritePropagation(
on: TableUpdateQuery.onTable(tableThatTheTriggerIsListeningOn),
result: [
TableUpdate.onTable(tableThatMightBeWrittenInto),
],
)
],
);
} |
We have a trigger (before insert) that inserts into another table. Using the watch() function in Drift does not seem to fire the callback for the update of the other table; it does fire the update for the original (i.e. Drift initiated) table though.
https://www.sqlite.org/c3ref/update_hook.html
Any thoughts on implementing this so that a Dart callback could be called for all (and not only Drift insertion) table updates?
Keep up the great work!
The text was updated successfully, but these errors were encountered: