xref: /netbsd-src/external/public-domain/sqlite/man/sqlite3_snapshot_recover.3 (revision bdc22b2e01993381dcefeff2bc9b56ca75a4235c)
1.Dd March 11, 2017
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 all connections disconnect from a database file but do not perform
15a checkpoint, the existing wal file is opened along with the database
16file the next time the database is opened.
17At this point it is only possible to successfully call sqlite3_snapshot_open()
18to open the most recent snapshot of the database (the one at the head
19of the wal file), even though the wal file may contain other valid
20snapshots for which clients have sqlite3_snapshot handles.
21.Pp
22This function attempts to scan the wal file associated with database
23zDb of database handle db and make all valid snapshots available to
24sqlite3_snapshot_open().
25It is an error if there is already a read transaction open on the database,
26or if the database is not a wal mode database.
27.Pp
28SQLITE_OK is returned if successful, or an SQLite error code otherwise.
29