VSQLite++ 0.3
Loading...
Searching...
No Matches
serialization.hpp File Reference

Wraps the optional sqlite3_serialize / sqlite3_deserialize APIs. More...

#include <span>
#include <string_view>
#include <vector>
Include dependency graph for serialization.hpp:

Go to the source code of this file.

Namespaces

namespace  sqlite
namespace  sqlite::v2

Functions

bool sqlite::v2::serialization_supported () noexcept
 Indicates whether the linked SQLite exposes the serialize/deserialise feature.
std::vector< unsigned char > sqlite::v2::serialize (connection &con, std::string_view schema="main", unsigned int flags=0)
 Copies the complete database image for schema into a byte vector.
void sqlite::v2::deserialize (connection &con, std::span< const unsigned char > image, std::string_view schema="main", bool read_only=false)
 Replaces the contents of schema with the supplied serialized image.

Detailed Description

Wraps the optional sqlite3_serialize / sqlite3_deserialize APIs.

These helpers snapshot an entire schema into memory or hydrate a connection from an in-memory image, which is useful for testing and for shipping pre-populated databases.

Definition in file serialization.hpp.