Name
sqlite3_backup_step() — Continue an online backup [EXP]
Definition
int sqlite3_backup_step( sqlite3_backup* backup, int pages );
-
backup An online backup handle.
-
pages The number of pages to copy. If this value is negative, all remaining pages are copied.
- Returns
An SQLite result code.
SQLITE_OKindicates the pages were successfully copied, but more pages remain.SQLITE_DONEindicates that a complete backup was made. Ifsqlite3_backup_step()returnsSQLITE_BUSYorSQLITE_LOCKED, the function can be safely retried at a later time.
Description
This function attempts to copy the specified number of pages
from the source database to the destination database. A shared
read lock is obtained and then released on the source database
for each call to sqlite3_backup_step(). Larger page counts
finish the backup more quickly, while smaller page counts allow
more concurrent access.
Modifications made to the source database through the same database connection that is being used for the backup are automatically reflected into the destination database, allowing the online backup to continue.
Modifications made to the source database through any other
database connection will cause the backup to reset and start
over. This is transparent. If an application is attempting to
back up a highly dynamic database it should call sqlite3_backup_step() very
frequently and use a very large page count, or it risks
continual reset. This could result in the backup perpetually
failing to complete.
See Also
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access