SQLITE3_SNAPSHOT_RECOVER(3)

NAME
sqlite3_snapshot_recover - Recover snapshots from a wal file

SYNOPSIS
#include <sqlite.h>
int
sqlite3_snapshot_recover(sqlite3 *db, const char *zDb);

DESCRIPTION
If all connections disconnect from a database file but do not perform a checkpoint, the existing wal file is opened along with the database file the next time the database is opened. At this point it is only possible to successfully call sqlite3_snapshot_open() to open the most recent snapshot of the database (the one at the head of the wal file), even though the wal file may contain other valid snapshots for which clients have sqlite3_snapshot handles.

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.

SQLITE_OK is returned if successful, or an SQLite error code otherwise.

IMPLEMENTATION NOTES
These declarations were extracted from the interface documentation at line 8994.

    SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_recover(sqlite3 *db, const char *zDb);