Open helje5 opened 2 years ago
Something straightforward that forwards notifications from https://www.sqlite.org/c3ref/update_hook.html would be helpful imho.
Since that callback gives the table id, and is called once for each changed rowid, it could associate changes with tables/views nicely and even group rowids together per transaction.
This can very quickly become non-Light, and maybe it shouldn't be actually done, but it might be useful to have a simple notification center that can broadcast DB change notifications. I had the feeling that it is better to let the user do this in own code as required.
I'd probably do this as a simple closure the user can hook up to anything he wants, like:
It quickly becomes a Pony, users might want to know the exact tables or IDs affected and so on, which sometimes isn't even possible w/ SQL itself. Transactions also complicate the matter.
Maybe rather something for Heavier. So a basic mechanism might be helpful.