3 #ifndef __SQLITEXX_SQLITE_BACKUP_H__
4 #define __SQLITEXX_SQLITE_BACKUP_H__
35 const std::string& sourceName =
"main",
36 const std::string& destinationName =
"main");
47 bool step(
const int pages = -1);
69 sqlite3_backup*
handle() noexcept;
72 using backup_handle = std::unique_ptr<sqlite3_backup, decltype(&sqlite3_backup_finish)>;
73 backup_handle m_handle;
81 void save(
const dbconnection& source,
const std::string& filename);
Used to aid in the process of backing up a database.
backup(const dbconnection &source, const dbconnection &destination, const std::string &sourceName="main", const std::string &destinationName="main")
Construct a backup object.
int remaining_page_count() noexcept
Returns the number of pages still to be backed up.
int total_page_count() noexcept
Returns the total number of pages in the source database.
bool step(const int pages=-1)
Will copy a specified number of pages to the destination database.
sqlite3_backup * handle() noexcept
Returns the pointer to the underlying sqlite3_backup object.
Class that represents a connection to a database.