Training courses

Kernel and Embedded Linux

Bootlin training courses

Embedded Linux, kernel,
Yocto Project, Buildroot, real-time,
graphics, boot time, debugging...

Bootlin logo

Elixir Cross Referencer

.Dd December 19, 2018
.Dt SQLITE3_SNAPSHOT_RECOVER 3
.Os
.Sh NAME
.Nm sqlite3_snapshot_recover
.Nd Recover snapshots from a wal file
.Sh SYNOPSIS
.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 sqlite3_close()) and a
new connection is subsequently opened on that database and WAL file,
the 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 SEE ALSO
.Xr sqlite3_file_control 3 ,
.Xr sqlite3_close 3 ,
.Xr sqlite3_snapshot_open 3 ,
.Xr SQLITE_FCNTL_LOCKSTATE 3