33#ifndef GUARD_SQLITE_SNAPSHOT_HPP_INCLUDED
34#define GUARD_SQLITE_SNAPSHOT_HPP_INCLUDED
39struct sqlite3_snapshot;
75 explicit operator bool() const noexcept {
wal_mode set_wal_mode(connection &con, wal_mode mode)
Force a specific WAL journal mode.
wal_mode get_wal_mode(connection &con)
Query the current journal mode for a connection.
std::string_view to_string(wal_mode mode)
Convert wal_mode to the corresponding PRAGMA token.
wal_mode enable_wal(connection &con, bool prefer_wal2=false)
Enable WAL, optionally preferring WAL2 with transparent fallback.
bool snapshots_supported() noexcept
Check if the linked SQLite library exposes snapshot helpers.
@ rollback
DELETE/legacy rollback journal.
connection is used to open, close, attach and detach a database. Further it has to be passed to all c...
RAII wrapper around sqlite3_snapshot.
sqlite3_snapshot * handle_
snapshot & operator=(snapshot const &)=delete
snapshot(snapshot const &)=delete
snapshot(sqlite3_snapshot *handle)
snapshot(snapshot &&other) noexcept
sqlite3_snapshot * native_handle() const noexcept
static snapshot take(connection &con, std::string_view schema="main")
Capture a snapshot for the provided connection/schema.
snapshot & operator=(snapshot &&other) noexcept
void open(connection &con, std::string_view schema="main") const
Rewind an open read transaction to this snapshot.
bool valid() const noexcept
void reset() noexcept
Release the managed sqlite3_snapshot (if owned).