Re: [sqlite] Best approach for "notifications"

2014-07-14 Thread Simon Slavin
On 14 Jul 2014, at 5:00pm, João Ramos wrote: > The update hook says "The update hook implementation must not do anything > that will modify the database connection that invoked the update hook. Ah, right. Yes, you must store what you want your change to be in a variable and make it after the

Re: [sqlite] Best approach for "notifications"

2014-07-14 Thread João Ramos
On Mon, Jul 14, 2014 at 3:57 PM, Simon Slavin wrote: > > The update hook function is an ideal way to do what you're doing. There > is also a pre-update hook: > > > > If you cannot use these, then my instinct is to try to figure out why,

Re: [sqlite] Best approach for "notifications"

2014-07-14 Thread Simon Slavin
On 14 Jul 2014, at 1:52pm, João Ramos wrote: > (for > example I know we cannot use sqlite3_update_hook to retrieve data) The update hook function is an ideal way to do what you're doing. There is also a pre-update hook: If you cann

[sqlite] Best approach for "notifications"

2014-07-14 Thread João Ramos
Hi, In a project I'm working on we need to have a mechanism that creates notifications when something happens in any given table. For example, for updates, we implemented something like: - create a ON UPDATE trigger in the target table - the trigger calls a custom function with every necessary c