diff options
author | John Turner <jturner.usa@gmail.com> | 2025-09-14 00:16:10 -0400 |
---|---|---|
committer | John Turner <jturner.usa@gmail.com> | 2025-09-14 00:16:10 -0400 |
commit | 13e0821fd783a1d5083d825af53cf20e8dcbfd76 (patch) | |
tree | 1ea363b0f13b3e87d177100e6ae6b9f30a2de1b8 /subprojects/boost-sqlite/doc/reference/backup.adoc | |
parent | aa55cb93036a89c64c08e08f4e1de4fa1fd5a775 (diff) | |
parent | efcea3a80da7c4479d5fe168435ecc9fd06bdc72 (diff) | |
download | sqlite-kv-bench-13e0821fd783a1d5083d825af53cf20e8dcbfd76.tar.gz |
Merge commit 'efcea3a80da7c4479d5fe168435ecc9fd06bdc72' as 'subprojects/boost-sqlite'
Diffstat (limited to 'subprojects/boost-sqlite/doc/reference/backup.adoc')
-rw-r--r-- | subprojects/boost-sqlite/doc/reference/backup.adoc | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/subprojects/boost-sqlite/doc/reference/backup.adoc b/subprojects/boost-sqlite/doc/reference/backup.adoc new file mode 100644 index 0000000..bc74619 --- /dev/null +++ b/subprojects/boost-sqlite/doc/reference/backup.adoc @@ -0,0 +1,43 @@ +== `sqlite/backup.hpp` +[#backup] + +Backup is a small wrapper function to create a backup of one database into another. +This can be useful to write an in memory database to disk et vice versa. + +[source,cpp] +---- +void +backup(connection & source, + connection & target, + cstring_ref source_name = "main", + cstring_ref target_name = "main"); + +void +backup(connection & source, + connection & target, + cstring_ref source_name, + cstring_ref target_name, + system::error_code & ec, + error_info & ei); +---- + + +source:: The source database to backup + +target:: The target of the backup + +source_name:: The source database to read the backup from. Default is 'main'. +target_name:: The target database to write the backup to. Default is 'main'. + + +.Example +[source,cpp] +---- +sqlite::connection conn{sqlite::in_memory}; +{ + sqlite::connection read{"./read_only_db.db", SQLITE_READONLY}; + // read peristed data into memory. + backup(read, target); +} +---- + |