Used to aid in the process of backing up a database. More...
#include <Backup.h>
Public Member Functions | |
| backup (const dbconnection &source, const dbconnection &destination, const std::string &sourceName="main", const std::string &destinationName="main") | |
| Construct a backup object. More... | |
| bool | step (const int pages=-1) |
| Will copy a specified number of pages to the destination database. More... | |
| int | total_page_count () noexcept |
| Returns the total number of pages in the source database. More... | |
| int | remaining_page_count () noexcept |
| Returns the number of pages still to be backed up. More... | |
| sqlite3_backup * | handle () noexcept |
| Returns the pointer to the underlying sqlite3_backup object. | |
Used to aid in the process of backing up a database.
The backup object records state information about an ongoing online backup operation. It us useful either for creating backups of databases or for copying in-memory databases to or from persistent files.
| sqlite::backup::backup | ( | const dbconnection & | source, |
| const dbconnection & | destination, | ||
| const std::string & | sourceName = "main", |
||
| const std::string & | destinationName = "main" |
||
| ) |
Construct a backup object.
| source | the database that will be the source of copied information |
| destination | the database that will be backed up to |
| sourceName | the source database name |
| destinationName | the destination database name |
| sqlite::exception | If an error occurs when initializing a backup then an sqlite::exception will be raised. |
Definition at line 14 of file Backup.cpp.
|
noexcept |
Returns the number of pages still to be backed up.
The values returned by this function is only updated by step(). If the source database is modified in a way that changes the size of the source database or the number of pages remaining, those changes are not reflected in the output of this method until after the next step().
Definition at line 51 of file Backup.cpp.
| bool sqlite::backup::step | ( | const int | pages = -1 | ) |
Will copy a specified number of pages to the destination database.
If pages is negative, all remaining source pages are copied.
pages the number of pages to copy from source to destination database.
| sqlite::exception | If an error occurs when initializing a backup then an sqlite::exception will be raised. |
Definition at line 34 of file Backup.cpp.
|
noexcept |
Returns the total number of pages in the source database.
The values returned by this function is only updated by step(). If the source database is modified in a way that changes the size of the source database or the number of pages remaining, those changes are not reflected in the output of this method until after the next step().
Definition at line 46 of file Backup.cpp.
1.8.6