On Sat, 8 Feb 2020 at 04:02, Jens Alfke <j...@mooseyard.com> wrote: > > On Feb 7, 2020, at 6:23 AM, Kees Nuyt <k.n...@zonnet.nl> wrote: > > > > Anyway, SQLite doesn't have such a mechanism by itself. > > Maybe inotify is useful to you : > > > > https://en.wikipedia.org/wiki/Inotify < > https://en.wikipedia.org/wiki/Inotify> > > http://man7.org/linux/man-pages/man7/inotify.7.html < > http://man7.org/linux/man-pages/man7/inotify.7.html> > > Or on Apple platforms, FSEvents. > > On any platform, you'd need to monitor both the main database and the .wal > file. > > And the notification would trigger soon after a transaction began making > changes, although the changes wouldn't be visible to you until the commit, > so you'd probably need to start polling until you see the changes, with > some heuristic about timing out if nothing happens for a while (e.g. if the > transaction is aborted.) >
See also PRAGMA data_version when it comes to polling the DB, the return value of which changes when another process modifies the DB. IIRC the implementation of this depends on a value in the DB header page, so it may be sufficient to only monitor the main DB file for changes. https://www.sqlite.org/pragma.html#pragma_data_version -Rowan _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users