SQLite Forum

Most efficient way to tell if any database content has changed
The simplest way is probably to hold-open a second connection to the database and periodically execute `PRAGMA data_version`.  If the value changes then *a different connection* has updated the data in the database.  Since this connection is used for nothing other than polling the data_version, you only need a very small cache_size for it.


Note that this is basically how a connection determines internally that the database file has been modified by another connection and must flush its page cache.