Template Class KeyValueDatabase

Class Documentation

template<KeyValueBackendConcept Backend>
class KeyValueDatabase

Public Types

using backend_type = Backend
using config_type = typename Backend::config_type

Public Functions

KeyValueDatabase() = default
inline KeyValueDatabase(KeyValueDatabase &&other) noexcept
inline KeyValueDatabase &operator=(KeyValueDatabase &&other) noexcept
KeyValueDatabase(const KeyValueDatabase&) = delete
KeyValueDatabase &operator=(const KeyValueDatabase&) = delete
inline ~KeyValueDatabase()
inline common::Result<void> close()
inline bool is_open() const noexcept
inline common::Result<bool> contains(std::string_view key) const
inline common::Result<Text> get_text(std::string_view key) const
inline common::Result<Bytes> get_bytes(std::string_view key) const
inline common::Result<void> put_text(std::string_view key, std::string_view value)
inline common::Result<void> put_bytes(std::string_view key, std::span<const std::byte> value)
inline common::Result<void> erase(std::string_view key)
inline common::Result<std::vector<Key>> list_keys(std::string_view prefix = {}) const
inline backend_type &backend() noexcept
inline const backend_type &backend() const noexcept

Public Static Functions

static inline common::Result<void> create(const config_type &cfg)
static inline common::Result<void> destroy(const config_type &cfg)
static inline common::Result<KeyValueDatabase> open(const config_type &cfg)