Re: [sqlite] Scope of sqlite3_update_hook?

2016-12-04 Thread Roger Binns
On 01/12/16 16:51, Jens Alfke wrote:
> If so, then does that include connections in other OS processes? (I'm looking 
> for a way to detect this.)

You can't get a callback when other processes change the database for
many reasons.  However it is possible to detect if the database has changed:

  https://www.sqlite.org/pragma.html#pragma_data_version
  https://www.sqlite.org/fileformat2.html#file_change_counter

In theory some combination of file change notification from the OS (eg
inotify) and inspecting the database should come close to meeting your
needs.

Roger



signature.asc
Description: OpenPGP digital signature
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Scope of sqlite3_update_hook?

2016-12-02 Thread Jens Alfke
Does a registered sqlite3_update_hook get called when _any_ SQLite connection 
modifies the database, or just the connection it's registered with?

If so, then does that include connections in other OS processes? (I'm looking 
for a way to detect this.)

--Jens [via iPhone]
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Scope of sqlite3_update_hook?

2016-12-01 Thread Igor Tandetnik

On 12/1/2016 7:51 PM, Jens Alfke wrote:

Does a registered sqlite3_update_hook get called when _any_ SQLite connection 
modifies the database (not just the connection it's registered with)?


No, only the connection it's registered with.


If so, then does that include connections in other OS processes? (I'm looking 
for a way to detect this.)


There's nothing in SQLite that would help with that, to my knowledge.
--
Igor Tandetnik

___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Scope of sqlite3_update_hook?

2016-12-01 Thread Jens Alfke
Does a registered sqlite3_update_hook get called when _any_ SQLite connection 
modifies the database (not just the connection it's registered with)?

If so, then does that include connections in other OS processes? (I'm looking 
for a way to detect this.)

—Jens
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users