SQLite Forum

Database WAL snapshot
Login
> there would then be no way to know if that snapshot was checkpointed out of the WAL

Well, there's the [File Change Counter](1), isn't there?

In WAL mode, when there's a WAL file, the counter comes from the WAL,  
so the DB file counter stays unchanged until checkpointed, no?

So if the snapshot data indicated whether its DB-only or DB+WAL, and  
included the DB's counter in the former case, then one can detect  
a *snapshot too old* case (to use the Oracle terminology),  
since I assume checkpointing updates the DB counter.

[1]: https://www.sqlite.org/fileformat.html#file_change_counter