1.Dd December 19, 2018 2.Dt SQLITE3_SNAPSHOT_RECOVER 3 3.Os 4.Sh NAME 5.Nm sqlite3_snapshot_recover 6.Nd Recover snapshots from a wal file 7.Sh SYNOPSIS 8.Ft int 9.Fo sqlite3_snapshot_recover 10.Fa "sqlite3 *db" 11.Fa "const char *zDb" 12.Fc 13.Sh DESCRIPTION 14If a WAL file remains on disk after all database connections 15close (either through the use of the SQLITE_FCNTL_PERSIST_WAL 16file control or because the last process to have the database 17opened exited without calling sqlite3_close()) and a 18new connection is subsequently opened on that database and WAL file, 19the sqlite3_snapshot_open() interface will only 20be able to open the last transaction added to the WAL file even though 21the WAL file contains other valid transactions. 22.Pp 23This function attempts to scan the WAL file associated with database 24zDb of database handle db and make all valid snapshots available to 25sqlite3_snapshot_open(). 26It is an error if there is already a read transaction open on the database, 27or if the database is not a WAL mode database. 28.Pp 29SQLITE_OK is returned if successful, or an SQLite error code otherwise. 30.Pp 31This interface is only available if SQLite is compiled with the SQLITE_ENABLE_SNAPSHOT 32option. 33.Sh SEE ALSO 34.Xr sqlite3_file_control 3 , 35.Xr sqlite3_close 3 , 36.Xr sqlite3_snapshot_open 3 , 37.Xr SQLITE_FCNTL_LOCKSTATE 3 38