[sqlite] sqlite3_update_hook() clarification

2016-03-09 Thread Sairam Gaddam
Thank you very much!! It helped a lot. On Wed, Mar 9, 2016 at 9:26 PM, Clemens Ladisch wrote: > Sairam Gaddam wrote: > > The documentation says that the function sqlite3_update_hook() is called > > whenever a row is updated, deleted or inserted > > No. It says that this function is called to

[sqlite] sqlite3_update_hook() clarification

2016-03-09 Thread Sairam Gaddam
http://www.sqlite.org/c3ref/update_hook.html The documentation says that the function sqlite3_update_hook() is called whenever a row is updated, deleted or inserted for a rowid table. But I don't find this function to be invoked in my program. When will this function be invoked?? And I am

[sqlite] sqlite3_update_hook() clarification

2016-03-09 Thread Clemens Ladisch
Sairam Gaddam wrote: > The documentation says that the function sqlite3_update_hook() is called > whenever a row is updated, deleted or inserted No. It says that this function is called to register a callback function that is called for these updates. > And I don't find any definition for this

Re: [sqlite] sqlite3_update_hook

2007-10-18 Thread Marco Bambini
Thanks Dennis for your reply. I would like to avoid triggers for performance reasons. I haven't found an official solution so I am implementing my own sqlite3_update_notify API that is executed before the operation takes place. --- Marco Bambini http://www.sqlabs.net

Re: [sqlite] sqlite3_update_hook

2007-10-18 Thread Dennis Cote
Marco Bambini wrote: with sqlite3_update_hook I can get the rowid of the row AFTER it has been INSERTed, DELETEd or UPDATEd. Is there a way to get the rowid of a row BEFORE it is DELETEd or UPDATEd ? If not, can someone suggest a good approach to this problem? Marco, You can use a "before

[sqlite] sqlite3_update_hook

2007-10-17 Thread Marco Bambini
Hi, with sqlite3_update_hook I can get the rowid of the row AFTER it has been INSERTed, DELETEd or UPDATEd. Is there a way to get the rowid of a row BEFORE it is DELETEd or UPDATEd ? If not, can someone suggest a good approach to this problem? Thanks a lot, --- Marco Bambini

[sqlite] sqlite3_update_hook does not get called when other app updates shared db

2007-08-02 Thread Chase
When i call sqlite3_update_hook() from App "A" and point it to my callback, i am only notified when app "A" updates the database. When app "B" (another instance of the same app as "A") updates the database, app "A"'s callback is never called, and vice versa. I thought the whole point of

[sqlite] sqlite3_update_hook

2007-03-15 Thread Slater, Chad
Hello, I'm trying to use the update hook functionality. I have lookup (aka join) tables that provide many-to-many relationships between rows in other tables. The problem is when I get the delete notification for the join tables the rowid is not useful in that context. I really need to know the

Re: [sqlite] sqlite3_update_hook and transactions

2007-03-12 Thread John Stanton
Make the hook queue a GUI update transaction and execute those transactions following the COMMIT. Discard the list of GUI update transactions on a ROLLBACK. Jef Driesen wrote: I was planning to use the sqlite3_update_hook function to notify my GUI about changes. The idea was that every part

Re: [sqlite] sqlite3_update_hook and transactions

2007-03-12 Thread drh
Jef Driesen <[EMAIL PROTECTED]> wrote: > > I think that approach should work. But the function sqlite3_commit_hook > is marked experimental in the documentation. What does that means? Is it > safe to rely on it? > "Experimental" means that we reserve the right to change it in future releases

Re: [sqlite] sqlite3_update_hook and transactions

2007-03-12 Thread Dan Kennedy
On Mon, 2007-03-12 at 10:51 +0100, Jef Driesen wrote: > I was planning to use the sqlite3_update_hook function to notify my GUI > about changes. The idea was that every part of the GUI can update itself > when a database change is detected. But during testing, I encountered > some problems with

[sqlite] sqlite3_update_hook and transactions

2007-03-12 Thread Jef Driesen
I was planning to use the sqlite3_update_hook function to notify my GUI about changes. The idea was that every part of the GUI can update itself when a database change is detected. But during testing, I encountered some problems with this approach together with transactions. When I group some

Re: [sqlite] sqlite3_update_hook

2006-04-13 Thread John Stanton
A wise computer scientist once told me "In Computer Science every problem can be solved by yet another level of indirection". Your problem is no exception. JS Cameron Tofer wrote: The rowid of the table's record in the sqlite_master table would be great, but really any unique integer that I

Re: [sqlite] sqlite3_update_hook

2006-04-13 Thread Dennis Cote
Cameron Tofer wrote: The rowid of the table's record in the sqlite_master table would be great, but really any unique integer that I can later use to get the table's name would be fine. Cameron, Then you should be able to execute the following SQL query in your sqlite3_update_hook handler

Re: [sqlite] sqlite3_update_hook

2006-04-13 Thread Cameron Tofer
The rowid of the table's record in the sqlite_master table would be great, but really any unique integer that I can later use to get the table's name would be fine. Dennis Cote wrote: Cameron Tofer wrote: Hi, I'd like to modifiy sqlite3_update_hook so the callback returns the table's id

Re: [sqlite] sqlite3_update_hook

2006-04-13 Thread Dennis Cote
Cameron Tofer wrote: Hi, I'd like to modifiy sqlite3_update_hook so the callback returns the table's id instead of the table's name. I'm not worried about proposing any official changes to the spec but rather a small customization for myself. Can anyone point me in the right direction

[sqlite] sqlite3_update_hook

2006-04-13 Thread Cameron Tofer
Hi, I'd like to modifiy sqlite3_update_hook so the callback returns the table's id instead of the table's name. I'm not worried about proposing any official changes to the spec but rather a small customization for myself. Can anyone point me in the right direction for this? At the point