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

Wraps SQLite's snapshot and WAL-mode management APIs. More...

#include <string>
#include <string_view>
Include dependency graph for snapshot.hpp:

Go to the source code of this file.

Classes

struct  sqlite::v2::snapshot
 RAII wrapper around sqlite3_snapshot. More...

Namespaces

namespace  sqlite
namespace  sqlite::v2

Enumerations

enum class  sqlite::v2::wal_mode {
  sqlite::v2::rollback , sqlite::v2::truncate , sqlite::v2::persist , sqlite::v2::memory ,
  sqlite::v2::wal , sqlite::v2::wal2
}

Functions

wal_mode sqlite::v2::set_wal_mode (connection &con, wal_mode mode)
 Force a specific WAL journal mode.
wal_mode sqlite::v2::enable_wal (connection &con, bool prefer_wal2=false)
 Enable WAL, optionally preferring WAL2 with transparent fallback.
wal_mode sqlite::v2::get_wal_mode (connection &con)
 Query the current journal mode for a connection.
std::string_view sqlite::v2::to_string (wal_mode mode)
 Convert wal_mode to the corresponding PRAGMA token.
bool sqlite::v2::snapshots_supported () noexcept
 Check if the linked SQLite library exposes snapshot helpers.

Detailed Description

Wraps SQLite's snapshot and WAL-mode management APIs.

Snapshots allow read transactions to observe a consistent view of a WAL database, while the helper functions here make it easier to toggle between journal modes.

Definition in file snapshot.hpp.