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.