.Dd January 24, 2024 .Dt SQLITE3_SNAPSHOT_RECOVER 3 .Os .Sh NAME .Nm sqlite3_snapshot_recover .Nd recover snapshots from a wal file .Sh SYNOPSIS .In sqlite3.h .Ft int .Fo sqlite3_snapshot_recover .Fa "sqlite3 *db" .Fa "const char *zDb" .Fc .Sh DESCRIPTION If a WAL file remains on disk after all database connections close (either through the use of the SQLITE_FCNTL_PERSIST_WAL file control or because the last process to have the database opened exited without calling .Fn sqlite3_close ) and a new connection is subsequently opened on that database and WAL file, the .Fn sqlite3_snapshot_open interface will only be able to open the last transaction added to the WAL file even though the WAL file contains other valid transactions. .Pp This function attempts to scan the WAL file associated with database zDb of database handle db and make all valid snapshots available to sqlite3_snapshot_open(). It is an error if there is already a read transaction open on the database, or if the database is not a WAL mode database. .Pp SQLITE_OK is returned if successful, or an SQLite error code otherwise. .Pp This interface is only available if SQLite is compiled with the SQLITE_ENABLE_SNAPSHOT option. .Sh IMPLEMENTATION NOTES These declarations were extracted from the interface documentation at line 10611. .Bd -literal SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_recover(sqlite3 *db, const char *zDb); .Ed .Sh SEE ALSO .Xr sqlite3_close 3 , .Xr sqlite3_file_control 3 , .Xr sqlite3_snapshot_open 3 , .Xr SQLITE_FCNTL_LOCKSTATE 3