|
ThinSQLite++
A thin, safe and convenient modern C++ wrapper for SQLite API.
|
Online backup object. More...
Public Types | |
| enum | step_result { done , success , busy , locked } |
| Result of a backup step. More... | |
Public Member Functions | |
| ~backup () noexcept | |
| Equivalent to sqlite3_backup_finish. | |
| step_result | step (int page_count) |
Copy up to page_count pages between the source and destination databases. | |
| int | remaining () const noexcept |
| Returns the number of pages still to be backed up after last step() | |
| int | pagecount () const noexcept |
| Returns the total number of pages in the source database after last step() | |
| void | operator delete (void *) noexcept |
| Operator delete for a fake pointer is no-op. | |
| sqlite3_backup * | c_ptr () const noexcept |
| Access the real underlying SQLite type. | |
Static Public Member Functions | |
| static std::unique_ptr< backup > | init (database &dst, const string_param &dest_dbname, database &src, const string_param &src_dbname) |
| Initialize the backup. | |
| static backup * | from (sqlite3_backup *obj) noexcept |
| Create fake pointer from the underlying SQLite one. | |
Online backup object.
This is a fake wrapper class for sqlite3_backup.
#include <thinsqlitepp/backup.hpp>
| enum step_result |
Result of a backup step.
| Enumerator | |
|---|---|
| done | Backup finished (SQLITE_DONE) |
| success | Backup step succeeded (SQLITE_OK) |
| busy | Database is busy, retry later (SQLITE_BUSY) |
| locked | Source database is being written, retry later (SQLITE_LOCKED) |
|
inlinestatic |
Initialize the backup.
Equivalent to sqlite3_backup_init
|
inline |
Copy up to page_count pages between the source and destination databases.
Equivalent to sqlite3_backup_step
|
inlinenoexcept |
Returns the number of pages still to be backed up after last step()
Equivalent to sqlite3_backup_remaining
|
inlinenoexcept |
Returns the total number of pages in the source database after last step()
Equivalent to sqlite3_backup_pagecount