Hi Roger Binns and R. Smith,

> Is the database being modified from within the same process, or from
> outside?
for that program I consider within the same process.

> 
> The update hook will tell you (most of the time) about changes within
> the same connection (ie if you are making the changes):
> 
>   https://sqlite.org/c3ref/update_hook.html
after reading, I think this should works. I will give a try.

> 
> The data_version pragma can tell you if something has changed, but
> you'll need to poll:
> 
>   https://www.sqlite.org/pragma.html#pragma_data_version
> 
> You can use change notification of the file system to know when the
> database file is changing and then do the pragma polling to find out
> when the change is complete.  For example on Windows the API starts
> with FindFirstChangeNotification and on Linux you'll find i/dnotify.
> Do make sure to monitor the main database file, as well as any other
> related filenames such as wal, journal and shm.
I try to do something like this with GIO, but I don't like how the code
looks like. I want (if I can) something more simpler.


> Best way to do so is using the Authorizer - read more here:
> 
> https://sqlite.org/c3ref/set_authorizer.html
sound interesting too, but I think using update_hook is simpler. Anyway
I keep this for some further uses.

thx to both of you.
Regards,
Nicolas J.

Reply via email to