C++ · Snapshots

Snapshots

#include <ustore/db.hpp> 1.0.0-rc.1 · d6d40961

API

Types

snapshot_tA point-in-time view of the whole database, which reads through it see until its destructor frees it.
db.hpp:724 ↗
class snapshot_t

It owns its handle, never copies, and holds its database open until destroyed, so it may outlive its database_t.

Classsnapshot_ref_tA point-in-time view of the whole database, as the calls on one executor see it, without owning either.7
db.hpp:652 ↗
class snapshot_ref_t

It hands out read-only collections and proxies.

snapshot_ref_t
db.hpp:657 ↗
snapshot_ref_t() noexcept=default;
snapshot_ref_t(receiver_t receiver) noexcept;
onThe same snapshot, running every call on executor.
db.hpp:664 ↗
snapshot_ref_t on(ustore_executor_t executor) const noexcept;
deferredThe same snapshot, whose verbs submit to executor and answer deferred calls.
db.hpp:667 ↗
deferred_snapshot_t deferred(ustore_executor_t executor) const noexcept;
collectionsLists the collections at the snapshot, with their identifiers in arena.
db.hpp:688 ↗
expected<collections_list_t> collections(arena_t & arena) noexcept;
containsWhether a collection named name exists at the snapshot.
db.hpp:691 ↗
expected<bool> contains(std::string_view name) noexcept;
findOpens a read-only view of one collection at the snapshot.
db.hpp:700 ↗
template <typename collection_type_ = blobs_collection_t>
expected<typename collection_type_::read_only_t> find(
    std::string_view name) noexcept;
saveSaves the snapshot as a new database at path, reporting the bytes saved to progress, which may cancel the save and so remove what it wrote.
db.hpp:708 ↗
status_t save(
    std::string_view path,
    progress_arg_t progress = {}) noexcept;