Skip to content
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

TBD: Add a change notification center #6

Open
helje5 opened this issue Aug 17, 2022 · 1 comment
Open

TBD: Add a change notification center #6

helje5 opened this issue Aug 17, 2022 · 1 comment
Labels
question Further information is requested

Comments

@helje5
Copy link
Member

helje5 commented Aug 17, 2022

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:

MyDatabase.onChange { some enum in  }

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.

@helje5 helje5 added the question Further information is requested label Aug 17, 2022
@PadraigK
Copy link

PadraigK commented Oct 2, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants