A fast and reliable embedded key-value ACID storage engine without WAL.
Version 0.14.3.9 (2026-08-13T13:36:35+03:00)
Loading...
Searching...
No Matches
C++ API

Topics

 exceptions and errors
 Slices and Buffers
 Environment, Transactions, Cursors, Key-value tables and map handles

Namespaces

namespace  mdbx
 The libmdbx C++ API namespace.
namespace  std
 STL namespace.

Macros

#define MDBX_CXX_HAS_POLYMORPHIC_ALLOCATOR   1
 Defined as 1 if the mdbx::polymorphic_allocator is available.
#define MDBX_STD_FILESYSTEM_PATH   ::mdbx::filesystem::path
 Defined if mdbx::filesystem::path is available.

Typedefs

using mdbx::byte = char8_t
 The byte-like type that don't presumes aliases for pointers as does the char.
using mdbx::version_info = ::MDBX_version_info
 libmdbx version information,
using mdbx::build_info = ::MDBX_build_info
 libmdbx build information
using mdbx::legacy_allocator = ::std::string::allocator_type
 Legacy allocator but it is recommended to use polymorphic_allocator.
using mdbx::polymorphic_allocator = ::std::pmr::string::allocator_type
 Default polymorphic allocator for modern code.
using mdbx::default_allocator = polymorphic_allocator
using mdbx::txnid = uint64_t
 Transaction ID and MVCC-snapshot number.
template<class ALLOCATOR = default_allocator>
using mdbx::string = ::std::basic_string<char, ::std::char_traits<char>, ALLOCATOR>
 Default single-byte string.
using mdbx::filehandle = ::mdbx_filehandle_t
using mdbx::path = ::mdbx::filesystem::path
using mdbx::path_string = ::mdbx::filesystem::path::string_type
using mdbx::path_char = path_string::value_type
using mdbx::duration = ::std::chrono::duration<unsigned, ::std::ratio<1, 65536>>
 Duration in 1/65536 units of second.
using mdbx::default_buffer = buffer<default_allocator, default_capacity_policy>
 Default buffer.
template<typename BUFFER>
using mdbx::buffer_pair = buffer_pair_spec<typename BUFFER::allocator_type, typename BUFFER::reservation_policy>
 Combines pair of buffers for key and value to hold an operands for certain operations.
using mdbx::default_buffer_pair = buffer_pair<default_buffer>
 Default pair of buffers.

Functions

constexpr const version_infomdbx::get_version () noexcept
 Returns libmdbx version information.
constexpr const build_infomdbx::get_build () noexcept
 Returns libmdbx build information.
constexpr bool mdbx::operator== (const error &a, const error &b)
constexpr bool mdbx::operator!= (const error &a, const error &b)
constexpr bool mdbx::operator== (const slice &a, const slice &b)
constexpr bool mdbx::operator< (const slice &a, const slice &b)
constexpr bool mdbx::operator> (const slice &a, const slice &b)
constexpr bool mdbx::operator<= (const slice &a, const slice &b)
constexpr bool mdbx::operator>= (const slice &a, const slice &b)
constexpr bool mdbx::operator!= (const slice &a, const slice &b)
template<class ALLOCATOR, typename CAPACITY_POLICY>
inline ::std::ostream & mdbx::operator<< (::std::ostream &out, const buffer< ALLOCATOR, CAPACITY_POLICY > &it)
 mdbx::MDBX_EXTERN_API_TEMPLATE (LIBMDBX_API_TYPE, buffer< legacy_allocator, default_capacity_policy >)
 mdbx::MDBX_EXTERN_API_TEMPLATE (LIBMDBX_API_TYPE, buffer< polymorphic_allocator, default_capacity_policy >)
template<class ALLOCATOR, class CAPACITY_POLICY, MutableByteProducer PRODUCER>
buffer< ALLOCATOR, CAPACITY_POLICY > mdbx::make_buffer (PRODUCER &producer, const ALLOCATOR &alloc)
template<class ALLOCATOR, class CAPACITY_POLICY, ImmutableByteProducer PRODUCER>
buffer< ALLOCATOR, CAPACITY_POLICY > mdbx::make_buffer (const PRODUCER &producer, const ALLOCATOR &alloc)
template<class ALLOCATOR, MutableByteProducer PRODUCER>
string< ALLOCATOR > mdbx::make_string (PRODUCER &producer, const ALLOCATOR &alloc)
template<class ALLOCATOR, ImmutableByteProducer PRODUCER>
string< ALLOCATOR > mdbx::make_string (const PRODUCER &producer, const ALLOCATOR &alloc)
constexpr bool mdbx::operator== (const pair &a, const pair &b)
constexpr bool mdbx::operator< (const pair &a, const pair &b)
constexpr bool mdbx::operator> (const pair &a, const pair &b)
constexpr bool mdbx::operator<= (const pair &a, const pair &b)
constexpr bool mdbx::operator>= (const pair &a, const pair &b)
constexpr bool mdbx::operator!= (const pair &a, const pair &b)
inline ::std::ostream & mdbx::operator<< (::std::ostream &out, const to_hex &wrapper)
inline ::std::ostream & mdbx::operator<< (::std::ostream &out, const to_base58 &wrapper)
inline ::std::ostream & mdbx::operator<< (::std::ostream &out, const to_base64 &wrapper)
int mdbx::compare_position_nothrow (const cursor &left, const cursor &right, bool ignore_nested=false)
int mdbx::compare_position (const cursor &left, const cursor &right, bool ignore_nested=false)
ptrdiff_t mdbx::estimate (const cursor &from, const cursor &to)
LIBMDBX_API::std::ostream & mdbx::operator<< (::std::ostream &, const slice &)
LIBMDBX_API::std::ostream & mdbx::operator<< (::std::ostream &, const pair &)
LIBMDBX_API::std::ostream & mdbx::operator<< (::std::ostream &, const pair_result &)
LIBMDBX_API::std::ostream & mdbx::operator<< (::std::ostream &, const env::geometry::size &)
LIBMDBX_API::std::ostream & mdbx::operator<< (::std::ostream &, const env::geometry &)
LIBMDBX_API::std::ostream & mdbx::operator<< (::std::ostream &, const env::operate_parameters &)
LIBMDBX_API::std::ostream & mdbx::operator<< (::std::ostream &, const env::mode &)
LIBMDBX_API::std::ostream & mdbx::operator<< (::std::ostream &, const env::durability &)
LIBMDBX_API::std::ostream & mdbx::operator<< (::std::ostream &, const env::reclaiming_options &)
LIBMDBX_API::std::ostream & mdbx::operator<< (::std::ostream &, const env::operate_options &)
LIBMDBX_API::std::ostream & mdbx::operator<< (::std::ostream &, const env_managed::create_parameters &)
LIBMDBX_API::std::ostream & mdbx::operator<< (::std::ostream &, const MDBX_log_level_t &)
LIBMDBX_API::std::ostream & mdbx::operator<< (::std::ostream &, const MDBX_debug_flags_t &)
LIBMDBX_API::std::ostream & mdbx::operator<< (::std::ostream &, const error &)
inline ::std::ostream & mdbx::operator<< (::std::ostream &out, const MDBX_error_t &errcode)
constexpr mdbx::map_handle::info::info (map_handle::flags flags, map_handle::state state) noexcept
MDBX_CXX11_CONSTEXPR_ENUM mdbx::key_mode mdbx::map_handle::info::key_mode () const noexcept
MDBX_CXX11_CONSTEXPR_ENUM mdbx::value_mode mdbx::map_handle::info::value_mode () const noexcept
bool mdbx::exception_thunk::is_clean () const noexcept
void mdbx::exception_thunk::capture () noexcept
void mdbx::exception_thunk::rethrow_captured () const
constexpr mdbx::error::error (MDBX_error_t error_code) noexcept
constexpr bool mdbx::error::is_success () const noexcept
constexpr bool mdbx::error::is_result_true () const noexcept
constexpr bool mdbx::error::is_result_false () const noexcept
constexpr bool mdbx::error::is_failure () const noexcept
constexpr MDBX_error_t mdbx::error::code () const noexcept
 Returns error code.
constexpr bool mdbx::error::is_mdbx_error () const noexcept
 Returns true for MDBX's errors.
static void mdbx::error::throw_exception (int error_code)
void mdbx::error::throw_on_failure () const
void mdbx::error::success_or_throw () const
void mdbx::error::success_or_throw (const exception_thunk &) const
static void mdbx::error::throw_on_nullptr (const void *ptr, MDBX_error_t error_code)
static void mdbx::error::throw_on_failure (int error_code)
static void mdbx::error::success_or_throw (MDBX_error_t error_code)
static bool mdbx::error::boolean_or_throw (int error_code)
static void mdbx::error::success_or_throw (int error_code, const exception_thunk &)
static bool mdbx::error::boolean_or_throw (int error_code, const exception_thunk &)
constexpr mdbx::slice::slice () noexcept
 Create an empty slice.
constexpr mdbx::slice::slice (const void *ptr, size_t bytes)
 Create a slice that refers to [0,bytes-1] of memory bytes pointed by ptr.
constexpr mdbx::slice::slice (const void *begin, const void *end)
 Create a slice that refers to [begin,end] of memory bytes.
constexpr mdbx::slice::slice (const char *c_str)
 Create a slice that refers to c_str[0,strlen(c_str)-1].
constexpr mdbx::slice::slice (const MDBX_val &src)
constexpr mdbx::slice::slice (MDBX_val &&src)
constexpr mdbx::slice::slice (slice &&src) noexcept
slicemdbx::slice::assign (const void *ptr, size_t bytes)
slicemdbx::slice::assign (const slice &src) noexcept
slicemdbx::slice::assign (const ::MDBX_val &src)
slicemdbx::slice::assign (slice &&src) noexcept
slicemdbx::slice::assign (::MDBX_val &&src)
slicemdbx::slice::assign (const void *begin, const void *end)
slicemdbx::slice::assign (const char *c_str)
slicemdbx::slice::operator= (slice &&src) noexcept
slicemdbx::slice::operator= (::MDBX_val &&src)
constexpr const bytemdbx::slice::byte_ptr () const noexcept
 Returns casted to pointer to byte an address of data.
constexpr const bytemdbx::slice::end_byte_ptr () const noexcept
 Returns casted to pointer to byte an end of data.
constexpr bytemdbx::slice::byte_ptr () noexcept
constexpr bytemdbx::slice::end_byte_ptr () noexcept
constexpr const char * mdbx::slice::char_ptr () const noexcept
 Returns casted to pointer to char an address of data.
constexpr const char * mdbx::slice::end_char_ptr () const noexcept
 Returns casted to pointer to char an end of data.
constexpr char * mdbx::slice::char_ptr () noexcept
constexpr char * mdbx::slice::end_char_ptr () noexcept
constexpr const void * mdbx::slice::data () const noexcept
 Return a pointer to the beginning of the referenced data.
constexpr const void * mdbx::slice::end () const noexcept
 Return a pointer to the ending of the referenced data.
constexpr void * mdbx::slice::data () noexcept
constexpr void * mdbx::slice::end () noexcept
constexpr size_t mdbx::slice::length () const noexcept
 Returns the number of bytes.
constexpr slicemdbx::slice::set_length (size_t bytes)
 Set slice length.
constexpr slicemdbx::slice::set_end (const void *ptr)
 Sets the length by specifying the end of the slice data.
constexpr bool mdbx::slice::empty () const noexcept
 Checks whether the slice is empty.
constexpr bool mdbx::slice::is_null () const noexcept
 Checks whether the slice data pointer is nullptr.
constexpr size_t mdbx::slice::size () const noexcept
 Returns the number of bytes.
constexpr void mdbx::slice::invalidate () noexcept
 Depletes content of slice and make it invalid.
constexpr void mdbx::slice::clear () noexcept
 Makes the slice empty and referencing to nothing.
void mdbx::slice::remove_prefix (size_t n) noexcept
 Drops the first "n" bytes from this slice.
void mdbx::slice::safe_remove_prefix (size_t n)
 Drops the first "n" bytes from this slice.
void mdbx::slice::remove_suffix (size_t n) noexcept
 Drops the last "n" bytes from this slice.
void mdbx::slice::safe_remove_suffix (size_t n)
 Drops the last "n" bytes from this slice.
constexpr bool mdbx::slice::starts_with (const slice &prefix) const noexcept
 Checks if the data starts with the given prefix.
constexpr bool mdbx::slice::ends_with (const slice &suffix) const noexcept
 Checks if the data ends with the given suffix.
constexpr size_t mdbx::slice::hash_value () const noexcept
 Returns the hash value of referenced data.
constexpr byte mdbx::slice::operator[] (size_t n) const noexcept
 Returns the nth byte in the referenced data.
constexpr byte mdbx::slice::at (size_t n) const
 Returns the nth byte in the referenced data with bounds checking.
constexpr slice mdbx::slice::head (size_t n) const noexcept
 Returns the first "n" bytes of the slice.
constexpr slice mdbx::slice::tail (size_t n) const noexcept
 Returns the last "n" bytes of the slice.
constexpr slice mdbx::slice::middle (size_t from, size_t n) const noexcept
 Returns the middle "n" bytes of the slice.
constexpr slice mdbx::slice::safe_head (size_t n) const
 Returns the first "n" bytes of the slice.
constexpr slice mdbx::slice::safe_tail (size_t n) const
 Returns the last "n" bytes of the slice.
constexpr slice mdbx::slice::safe_middle (size_t from, size_t n) const
 Returns the middle "n" bytes of the slice.
static constexpr intptr_t mdbx::slice::compare_fast (const slice &a, const slice &b) noexcept
 Three-way fast non-lexicographically length-based comparison.
static constexpr intptr_t mdbx::slice::compare_lexicographically (const slice &a, const slice &b) noexcept
 Three-way lexicographically comparison.
constexpr mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer (const struct slice &src, bool make_reference, const allocator_type &alloc=allocator_type())
template<class ALLOCATOR, typename CAPACITY_POLICY>
 mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer (const txn &transaction, const struct slice &src, const allocator_type &alloc)
template<class ALLOCATOR = default_allocator>
string< ALLOCATOR > mdbx::to_hex::as_string (const ALLOCATOR &alloc=ALLOCATOR()) const
 Returns a string with a hexadecimal dump of a passed slice.
template<class ALLOCATOR = default_allocator, typename CAPACITY_POLICY = default_capacity_policy>
buffer< ALLOCATOR, CAPACITY_POLICY > mdbx::to_hex::as_buffer (const ALLOCATOR &alloc=ALLOCATOR()) const
 Returns a buffer with a hexadecimal dump of a passed slice.
template<class ALLOCATOR = default_allocator>
string< ALLOCATOR > mdbx::to_base58::as_string (const ALLOCATOR &alloc=ALLOCATOR()) const
 Returns a string with a Base58 dump of a passed slice.
template<class ALLOCATOR = default_allocator, typename CAPACITY_POLICY = default_capacity_policy>
buffer< ALLOCATOR, CAPACITY_POLICY > mdbx::to_base58::as_buffer (const ALLOCATOR &alloc=ALLOCATOR()) const
 Returns a buffer with a Base58 dump of a passed slice.
template<class ALLOCATOR = default_allocator>
string< ALLOCATOR > mdbx::to_base64::as_string (const ALLOCATOR &alloc=ALLOCATOR()) const
 Returns a string with a Base64 dump of a passed slice.
template<class ALLOCATOR = default_allocator, typename CAPACITY_POLICY = default_capacity_policy>
buffer< ALLOCATOR, CAPACITY_POLICY > mdbx::to_base64::as_buffer (const ALLOCATOR &alloc=ALLOCATOR()) const
 Returns a buffer with a Base64 dump of a passed slice.
template<class ALLOCATOR = default_allocator>
string< ALLOCATOR > mdbx::from_hex::as_string (const ALLOCATOR &alloc=ALLOCATOR()) const
 Decodes hexadecimal dump from a passed slice to returned string.
template<class ALLOCATOR = default_allocator, typename CAPACITY_POLICY = default_capacity_policy>
buffer< ALLOCATOR, CAPACITY_POLICY > mdbx::from_hex::as_buffer (const ALLOCATOR &alloc=ALLOCATOR()) const
 Decodes hexadecimal dump from a passed slice to returned buffer.
template<class ALLOCATOR = default_allocator>
string< ALLOCATOR > mdbx::from_base58::as_string (const ALLOCATOR &alloc=ALLOCATOR()) const
 Decodes Base58 dump from a passed slice to returned string.
template<class ALLOCATOR = default_allocator, typename CAPACITY_POLICY = default_capacity_policy>
buffer< ALLOCATOR, CAPACITY_POLICY > mdbx::from_base58::as_buffer (const ALLOCATOR &alloc=ALLOCATOR()) const
 Decodes Base58 dump from a passed slice to returned buffer.
template<class ALLOCATOR = default_allocator>
string< ALLOCATOR > mdbx::from_base64::as_string (const ALLOCATOR &alloc=ALLOCATOR()) const
 Decodes Base64 dump from a passed slice to returned string.
template<class ALLOCATOR = default_allocator, typename CAPACITY_POLICY = default_capacity_policy>
buffer< ALLOCATOR, CAPACITY_POLICY > mdbx::from_base64::as_buffer (const ALLOCATOR &alloc=ALLOCATOR()) const
 Decodes Base64 dump from a passed slice to returned buffer.
template<class ALLOCATOR = default_allocator>
string< ALLOCATOR > mdbx::slice::as_hex_string (bool uppercase=false, unsigned wrap_width=0, const ALLOCATOR &alloc=ALLOCATOR()) const
 Returns a string with a hexadecimal dump of the slice content.
template<class ALLOCATOR = default_allocator>
string< ALLOCATOR > mdbx::slice::as_base58_string (unsigned wrap_width=0, const ALLOCATOR &alloc=ALLOCATOR()) const
 Returns a string with a Base58 dump of the slice content.
template<class ALLOCATOR = default_allocator>
string< ALLOCATOR > mdbx::slice::as_base64_string (unsigned wrap_width=0, const ALLOCATOR &alloc=ALLOCATOR()) const
 Returns a string with a Base58 dump of the slice content.
template<class ALLOCATOR = default_allocator, class CAPACITY_POLICY = default_capacity_policy>
buffer< ALLOCATOR, CAPACITY_POLICY > mdbx::slice::encode_hex (bool uppercase=false, unsigned wrap_width=0, const ALLOCATOR &alloc=ALLOCATOR()) const
 Returns a buffer with a hexadecimal dump of the slice content.
template<class ALLOCATOR = default_allocator, class CAPACITY_POLICY = default_capacity_policy>
buffer< ALLOCATOR, CAPACITY_POLICY > mdbx::slice::encode_base58 (unsigned wrap_width=0, const ALLOCATOR &alloc=ALLOCATOR()) const
 Returns a buffer with a Base58 dump of the slice content.
template<class ALLOCATOR = default_allocator, class CAPACITY_POLICY = default_capacity_policy>
buffer< ALLOCATOR, CAPACITY_POLICY > mdbx::slice::encode_base64 (unsigned wrap_width=0, const ALLOCATOR &alloc=ALLOCATOR()) const
 Returns a buffer with a Base64 dump of the slice content.
template<class ALLOCATOR = default_allocator, class CAPACITY_POLICY = default_capacity_policy>
buffer< ALLOCATOR, CAPACITY_POLICY > mdbx::slice::hex_decode (bool ignore_spaces=false, const ALLOCATOR &alloc=ALLOCATOR()) const
 Decodes hexadecimal dump from the slice content to returned buffer.
template<class ALLOCATOR = default_allocator, class CAPACITY_POLICY = default_capacity_policy>
buffer< ALLOCATOR, CAPACITY_POLICY > mdbx::slice::base58_decode (bool ignore_spaces=false, const ALLOCATOR &alloc=ALLOCATOR()) const
 Decodes Base58 dump from the slice content to returned buffer.
template<class ALLOCATOR = default_allocator, class CAPACITY_POLICY = default_capacity_policy>
buffer< ALLOCATOR, CAPACITY_POLICY > mdbx::slice::base64_decode (bool ignore_spaces=false, const ALLOCATOR &alloc=ALLOCATOR()) const
 Decodes Base64 dump from the slice content to returned buffer.
static constexpr intptr_t mdbx::pair::compare_fast (const pair &a, const pair &b) noexcept
 Three-way fast non-lexicographically length-based comparison.
static constexpr intptr_t mdbx::pair::compare_lexicographically (const pair &a, const pair &b) noexcept
 Three-way lexicographically comparison.
bool mdbx::slice::is_hex (bool ignore_spaces=false) const noexcept
 Checks whether the content of the slice is a hexadecimal dump.
bool mdbx::slice::is_base58 (bool ignore_spaces=false) const noexcept
 Checks whether the content of the slice is a Base58 dump.
bool mdbx::slice::is_base64 (bool ignore_spaces=false) const noexcept
 Checks whether the content of the slice is a Base64 dump.
constexpr mdbx::env::env (MDBX_env *ptr) noexcept
envmdbx::env::operator= (env &&) noexcept
 mdbx::env::env (env &&) noexcept
 mdbx::env::~env () noexcept
geometrymdbx::env::geometry::make_fixed (intptr_t size) noexcept
geometrymdbx::env::geometry::make_dynamic (intptr_t lower=default_value, intptr_t upper=default_value) noexcept
static env::reclaiming_options mdbx::env::operate_parameters::reclaiming_from_flags (MDBX_env_flags_t flags) noexcept
static env::operate_options mdbx::env::operate_parameters::options_from_flags (MDBX_env_flags_t flags) noexcept
static size_t mdbx::env::limits::pagesize_min () noexcept
 Returns the minimal database page size in bytes.
static size_t mdbx::env::limits::pagesize_max () noexcept
 Returns the maximal database page size in bytes.
static size_t mdbx::env::limits::dbsize_min (intptr_t pagesize)
 Returns the minimal database size in bytes for specified page size.
static size_t mdbx::env::limits::dbsize_max (intptr_t pagesize)
 Returns the maximal database size in bytes for specified page size.
static size_t mdbx::env::limits::key_min (MDBX_db_flags_t flags) noexcept
 Returns the minimal key size in bytes for specified table flags.
static size_t mdbx::env::limits::key_min (key_mode mode) noexcept
 Returns the minimal key size in bytes for specified keys mode.
static size_t mdbx::env::limits::key_max (intptr_t pagesize, MDBX_db_flags_t flags)
 Returns the maximal key size in bytes for specified page size and table flags.
static size_t mdbx::env::limits::key_max (intptr_t pagesize, key_mode mode)
 Returns the maximal key size in bytes for specified page size and keys mode.
static size_t mdbx::env::limits::key_max (const env &, MDBX_db_flags_t flags)
 Returns the maximal key size in bytes for given environment and table flags.
static size_t mdbx::env::limits::key_max (const env &, key_mode mode)
 Returns the maximal key size in bytes for given environment and keys mode.
static size_t mdbx::env::limits::value_min (MDBX_db_flags_t flags) noexcept
 Returns the minimal values size in bytes for specified table flags.
static size_t mdbx::env::limits::value_min (value_mode) noexcept
 Returns the minimal values size in bytes for specified values mode.
static size_t mdbx::env::limits::value_max (intptr_t pagesize, MDBX_db_flags_t flags)
 Returns the maximal value size in bytes for specified page size and table flags.
static size_t mdbx::env::limits::value_max (intptr_t pagesize, value_mode)
 Returns the maximal value size in bytes for specified page size and values mode.
static size_t mdbx::env::limits::value_max (const env &, MDBX_db_flags_t flags)
 Returns the maximal value size in bytes for given environment and table flags.
static size_t mdbx::env::limits::value_max (const env &, value_mode)
 Returns the maximal value size in bytes for specified page size and values mode.
static size_t mdbx::env::limits::pairsize4page_max (intptr_t pagesize, MDBX_db_flags_t flags)
 Returns maximal size of key-value pair to fit in a single page for specified size and table flags.
static size_t mdbx::env::limits::pairsize4page_max (intptr_t pagesize, value_mode)
 Returns maximal size of key-value pair to fit in a single page for specified page size and values mode.
static size_t mdbx::env::limits::pairsize4page_max (const env &, MDBX_db_flags_t flags)
 Returns maximal size of key-value pair to fit in a single page for given environment and table flags.
static size_t mdbx::env::limits::pairsize4page_max (const env &, value_mode)
 Returns maximal size of key-value pair to fit in a single page for specified page size and values mode.
static size_t mdbx::env::limits::valsize4page_max (intptr_t pagesize, MDBX_db_flags_t flags)
 Returns maximal data size in bytes to fit in a leaf-page or single large/overflow-page for specified size and table flags.
static size_t mdbx::env::limits::valsize4page_max (intptr_t pagesize, value_mode)
 Returns maximal data size in bytes to fit in a leaf-page or single large/overflow-page for specified page size and values mode.
static size_t mdbx::env::limits::valsize4page_max (const env &, MDBX_db_flags_t flags)
 Returns maximal data size in bytes to fit in a leaf-page or single large/overflow-page for given environment and table flags.
static size_t mdbx::env::limits::valsize4page_max (const env &, value_mode)
 Returns maximal data size in bytes to fit in a leaf-page or single large/overflow-page for specified page size and values mode.
static size_t mdbx::env::limits::transaction_size_max (intptr_t pagesize)
 Returns the maximal write transaction size (i.e. limit for summary volume of dirty pages) in bytes for specified page size.
static size_t mdbx::env::limits::max_map_handles (void)
 Returns the maximum opened map handles, aka DBI-handles.
env::operate_parameters mdbx::env::get_operation_parameters () const
 Returns current operation parameters.
env::mode mdbx::env::get_mode () const
 Returns current operation mode.
env::durability mdbx::env::get_durability () const
 Returns current durability mode.
env::reclaiming_options mdbx::env::get_reclaiming () const
 Returns current reclaiming options.
env::operate_options mdbx::env::get_options () const
 Returns current operate options.
stat mdbx::env::get_stat () const
 Returns snapshot statistics about the MDBX environment.
stat mdbx::env::get_stat (const txn &) const
 Return statistics about the MDBX environment accordingly to the specified transaction.
info mdbx::env::get_info () const
 Return snapshot information about the MDBX environment.
info mdbx::env::get_info (const txn &) const
 Return information about the MDBX environment accordingly to the specified transaction.
filehandle mdbx::env::get_filehandle () const
 Returns the file descriptor for the DXB file of MDBX environment.
MDBX_env_flags_t mdbx::env::get_flags () const
 Returns environment flags.
unsigned mdbx::env::max_readers () const
 Returns the maximum number of threads/reader slots for the environment.
unsigned mdbx::env::max_maps () const
 Returns the maximum number of named tables for the environment.
void * mdbx::env::get_context () const noexcept
 Returns the application context associated with the environment.
envmdbx::env::set_context (void *your_context)
 Sets the application context associated with the environment.
envmdbx::env::set_sync_threshold (size_t bytes)
 Sets threshold to force flush the data buffers to disk, for non-sync durability modes.
size_t mdbx::env::sync_threshold () const
 Gets threshold used to force flush the data buffers to disk, for non-sync durability modes.
envmdbx::env::set_sync_period__seconds_16dot16 (unsigned seconds_16dot16)
 Sets relative period since the last unsteady commit to force flush the data buffers to disk, for non-sync durability modes.
unsigned mdbx::env::sync_period__seconds_16dot16 () const
 Gets relative period since the last unsteady commit that used to force flush the data buffers to disk, for non-sync durability modes.
envmdbx::env::set_sync_period__seconds_double (double seconds)
 Sets relative period since the last unsteady commit to force flush the data buffers to disk, for non-sync durability modes.
double mdbx::env::sync_period__seconds_double () const
 Gets relative period since the last unsteady commit that used to force flush the data buffers to disk, for non-sync durability modes.
envmdbx::env::set_extra_option (extra_runtime_option option, uint64_t value)
 Sets the value of a extra runtime options for an environment.
uint64_t mdbx::env::extra_option (extra_runtime_option option) const
 Gets the value of extra runtime options from an environment.
envmdbx::env::alter_flags (MDBX_env_flags_t flags, bool on_off)
 Alter environment flags.
envmdbx::env::set_geometry (const geometry &size)
 Set all size-related parameters of environment.
bool mdbx::env::sync_to_disk (bool force=true, bool nonblock=false)
 Flush the environment data buffers.
void mdbx::env::close_map (const map_handle &)
 Close a key-value map (aka table) handle. Normally unnecessary.
constexpr mdbx::env::reader_info::reader_info (int slot, mdbx_pid_t pid, mdbx_tid_t thread, uint64_t txnid, uint64_t lag, size_t used, size_t retained) noexcept
template<typename VISITOR>
int mdbx::env::enumerate_readers (VISITOR &visitor)
 Enumerate readers.
unsigned mdbx::env::check_readers ()
 Checks for stale readers in the lock table and return number of cleared slots.
envmdbx::env::set_HandleSlowReaders (MDBX_hsr_func)
 Sets a Handle-Slow-Readers callback to resolve database full/overflow issue due to a reader(s) which prevents the old data from being recycled.
MDBX_hsr_func mdbx::env::get_HandleSlowReaders () const noexcept
 Returns the current Handle-Slow-Readers callback used to resolve database full/overflow issue due to a reader(s) which prevents the old data from being recycled.
txn_managed mdbx::env::start_read () const
 Starts read (read-only) transaction.
txn_managed mdbx::env::prepare_read () const
 Creates but not start read transaction.
txn_managed mdbx::env::start_write (bool dont_wait=false)
 Starts write (read-write) transaction.
txn_managed mdbx::env::start_write (txn &parent)
 Starts write (read-write) transaction.
txn_managed mdbx::env::try_start_write ()
 Tries to start write (read-write) transaction without blocking.
constexpr mdbx::txn::txn (MDBX_txn *ptr) noexcept
txnmdbx::txn::operator= (txn &&) noexcept
 mdbx::txn::txn (txn &&) noexcept
 mdbx::txn::~txn () noexcept
void * mdbx::txn::get_context () const noexcept
 Returns the application context associated with the transaction.
txnmdbx::txn::set_context (void *your_context)
 Sets the application context associated with the transaction.
bool mdbx::txn::is_dirty (const void *ptr) const
 Checks whether the given data is on a dirty page.
inline ::mdbx::env mdbx::txn::env () const noexcept
 Returns the transaction's environment.
MDBX_txn_flags_t mdbx::txn::flags () const
 Returns transaction's flags.
uint64_t mdbx::txn::id () const
 Return the transaction's ID.
void mdbx::txn::reset_reading ()
 Reset read-only transaction.
void mdbx::txn::make_broken ()
 Marks transaction as broken to prevent further operations.
void mdbx::txn::renew_reading ()
 Renew read-only transaction.
txn_managed mdbx::txn::clone (void *context=nullptr) const
 Clone read transaction.
void mdbx::txn::clone (txn_managed &txn_for_renew_into_clone, void *context=nullptr) const
 Renew given read transaction into clone.
void mdbx::txn::park_reading (bool autounpark=true)
 Park read-only transaction.
bool mdbx::txn::unpark_reading (bool restart_if_ousted=true)
 Resume parked read-only transaction.
info mdbx::txn::get_info (bool scan_reader_lock_table=false) const
 Returns information about the MDBX transaction.
cursor_managed mdbx::txn::open_cursor (map_handle map) const
 Opens cursor for specified key-value map handle.
size_t mdbx::txn::release_all_cursors (bool unbind) const
 Unbind or close all cursors.
map_handle mdbx::txn::open_map (const slice &name, const ::mdbx::key_mode key_mode=::mdbx::key_mode::usual, const ::mdbx::value_mode value_mode=::mdbx::value_mode::single) const
 Open existing key-value map.
map_handle mdbx::txn::open_map (const char *name, const ::mdbx::key_mode key_mode=::mdbx::key_mode::usual, const ::mdbx::value_mode value_mode=::mdbx::value_mode::single) const
 Open existing key-value map.
map_handle mdbx::txn::open_map_accede (const slice &name) const
 Open existing key-value map.
map_handle mdbx::txn::open_map_accede (const char *name) const
 Open existing key-value map.
map_handle mdbx::txn::create_map (const slice &name, const ::mdbx::key_mode key_mode=::mdbx::key_mode::usual, const ::mdbx::value_mode value_mode=::mdbx::value_mode::single)
 Create new or open existing key-value map.
map_handle mdbx::txn::create_map (const char *name, const ::mdbx::key_mode key_mode=::mdbx::key_mode::usual, const ::mdbx::value_mode value_mode=::mdbx::value_mode::single)
 Create new or open existing key-value map.
void mdbx::txn::drop_map (map_handle map)
 Drops key-value map using handle.
void mdbx::txn::clear_map (map_handle map)
 Clear key-value map.
void mdbx::txn::rename_map (map_handle map, const char *new_name)
 Переименовывает таблицу ключ-значение.
void mdbx::txn::rename_map (map_handle map, const slice &new_name)
 Переименовывает таблицу ключ-значение.
map_handle mdbx::txn::open_map (const ::std::string &name, const ::mdbx::key_mode key_mode=::mdbx::key_mode::usual, const ::mdbx::value_mode value_mode=::mdbx::value_mode::single) const
 Open existing key-value map.
map_handle mdbx::txn::open_map_accede (const ::std::string &name) const
 Open existing key-value map.
map_handle mdbx::txn::create_map (const ::std::string &name, const ::mdbx::key_mode key_mode=::mdbx::key_mode::usual, const ::mdbx::value_mode value_mode=::mdbx::value_mode::single)
 Create new or open existing key-value map.
bool mdbx::txn::drop_map (const ::std::string &name, bool throw_if_absent=false)
 Drop key-value map.
bool mdbx::txn::clear_map (const ::std::string &name, bool throw_if_absent=false)
void mdbx::txn::rename_map (map_handle map, const ::std::string &new_name)
 Переименовывает таблицу ключ-значение.
map_stat mdbx::txn::get_map_stat (map_handle map) const
 Returns statistics for a table.
uint32_t mdbx::txn::get_tree_deepmask (map_handle map) const
 Returns depth (bitmask) information of nested dupsort (multi-value) B+trees for given table.
map_handle::info mdbx::txn::get_map_flags (map_handle map) const
 Returns information about key-value map (aka table) handle.
txnmdbx::txn::put_canary (const canary &)
 Set integers markers (aka "canary") associated with the environment.
canary mdbx::txn::get_canary () const
 Returns fours integers markers (aka "canary") associated with the environment.
uint64_t mdbx::txn::sequence (map_handle map) const
 Reads sequence generator associated with a key-value map (aka table).
uint64_t mdbx::txn::sequence (map_handle map, uint64_t increment)
 Reads and increment sequence generator associated with a key-value map (aka table).
int mdbx::txn::compare_keys (map_handle map, const slice &a, const slice &b) const noexcept
 Compare two keys according to a particular key-value map (aka table).
int mdbx::txn::compare_values (map_handle map, const slice &a, const slice &b) const noexcept
 Compare two values according to a particular key-value map (aka table).
int mdbx::txn::compare_keys (map_handle map, const pair &a, const pair &b) const noexcept
 Compare keys of two pairs according to a particular key-value map (aka table).
int mdbx::txn::compare_values (map_handle map, const pair &a, const pair &b) const noexcept
 Compare values of two pairs according to a particular key-value map(aka table).
slice mdbx::txn::get (map_handle map, const slice &key) const
 Get value by key from a key-value map (aka table).
slice mdbx::txn::get (map_handle map, slice key, size_t &values_count) const
 Get first of multi-value and values count by key from a key-value multimap (aka table).
slice mdbx::txn::get (map_handle map, const slice &key, const slice &value_at_absence) const
 Get value by key from a key-value map (aka table).
slice mdbx::txn::get (map_handle map, slice key, size_t &values_count, const slice &value_at_absence) const
 Get first of multi-value and values count by key from a key-value multimap (aka table).
pair_result mdbx::txn::get_equal_or_great (map_handle map, const slice &key) const
 Get value for equal or great key from a table.
pair_result mdbx::txn::get_equal_or_great (map_handle map, const slice &key, const slice &value_at_absence) const
 Get value for equal or great key from a table.
MDBX_error_t mdbx::txn::put (map_handle map, const slice &key, slice *value, MDBX_put_flags_t flags) noexcept
void mdbx::txn::put (map_handle map, const slice &key, slice value, put_mode mode)
void mdbx::txn::insert (map_handle map, const slice &key, slice value)
value_result mdbx::txn::try_insert (map_handle map, const slice &key, slice value)
slice mdbx::txn::insert_reserve (map_handle map, const slice &key, size_t value_length)
value_result mdbx::txn::try_insert_reserve (map_handle map, const slice &key, size_t value_length)
void mdbx::txn::upsert (map_handle map, const slice &key, const slice &value)
slice mdbx::txn::upsert_reserve (map_handle map, const slice &key, size_t value_length)
void mdbx::txn::update (map_handle map, const slice &key, const slice &value)
bool mdbx::txn::try_update (map_handle map, const slice &key, const slice &value)
slice mdbx::txn::update_reserve (map_handle map, const slice &key, size_t value_length)
value_result mdbx::txn::try_update_reserve (map_handle map, const slice &key, size_t value_length)
bool mdbx::txn::erase (map_handle map, const slice &key)
 Removes all values for given key.
bool mdbx::txn::erase (map_handle map, const slice &key, const slice &value)
 Removes the particular multi-value entry of the key.
void mdbx::txn::replace (map_handle map, const slice &key, slice &old_value, const slice &new_value)
 Replaces the particular multi-value of the key with a new value.
template<class BUFFER, class ALLOCATOR = typename BUFFER::allocator_type>
BUFFER mdbx::txn::extract (map_handle map, const slice &key, const ALLOCATOR &alloc=ALLOCATOR())
 Removes and return a value of the key.
template<class BUFFER, class ALLOCATOR = typename BUFFER::allocator_type>
BUFFER mdbx::txn::replace (map_handle map, const slice &key, const slice &new_value, const ALLOCATOR &alloc=ALLOCATOR())
 Replaces and returns a value of the key with new one.
template<class BUFFER, class ALLOCATOR = typename BUFFER::allocator_type>
BUFFER mdbx::txn::replace_reserve (map_handle map, const slice &key, size_t length, slice &new_value_reservation, const ALLOCATOR &alloc=ALLOCATOR())
void mdbx::txn::append (map_handle map, const slice &key, const slice &value, bool multivalue_order_preserved=true)
 Adding a key-value pair, provided that ascending order of the keys and (optionally) values are preserved.
size_t mdbx::txn::put_multiple_samelength (map_handle map, const slice &key, const size_t value_length, const void *values_array, size_t values_count, put_mode mode, bool allow_partial=false)
ptrdiff_t mdbx::txn::estimate (map_handle map, const pair &from, const pair &to) const
ptrdiff_t mdbx::txn::estimate (map_handle map, const slice &from, const slice &to) const
ptrdiff_t mdbx::txn::estimate_from_first (map_handle map, const slice &to) const
ptrdiff_t mdbx::txn::estimate_to_last (map_handle map, const slice &from) const
constexpr mdbx::cursor::cursor (MDBX_cursor *ptr) noexcept
cursormdbx::cursor::assign (const cursor &)
cursormdbx::cursor::operator= (cursor &&) noexcept
 mdbx::cursor::cursor (cursor &&) noexcept
 mdbx::cursor::~cursor () noexcept
void * mdbx::cursor::get_context () const noexcept
 Returns the application context associated with the cursor.
cursormdbx::cursor::set_context (void *your_context)
 Sets the application context associated with the cursor.
 mdbx::cursor::move_result::move_result (const cursor &cursor, bool throw_notfound)
 mdbx::cursor::move_result::move_result (cursor &cursor, move_operation operation, const slice &key, const slice &value, bool throw_notfound)
bool mdbx::cursor::move (move_operation operation, MDBX_val *key, MDBX_val *value, bool throw_notfound) const
 mdbx::cursor::estimate_result::estimate_result (const cursor &cursor, move_operation operation, const slice &key, const slice &value)
ptrdiff_t mdbx::cursor::estimate (move_operation operation, MDBX_val *key, MDBX_val *value) const
move_result mdbx::cursor::find (const slice &key, bool throw_notfound=true)
move_result mdbx::cursor::lower_bound (const slice &key, bool throw_notfound=false)
move_result mdbx::cursor::upper_bound (const slice &key, bool throw_notfound=false)
move_result mdbx::cursor::find_multivalue (const slice &key, const slice &value, bool throw_notfound=true)
move_result mdbx::cursor::lower_bound_multivalue (const slice &key, const slice &value, bool throw_notfound=false)
move_result mdbx::cursor::upper_bound_multivalue (const slice &key, const slice &value, bool throw_notfound=false)
bool mdbx::cursor::seek (const slice &key)
size_t mdbx::cursor::count_multivalue () const
 Return count of duplicates for current key.
bool mdbx::cursor::eof () const
bool mdbx::cursor::on_first () const
bool mdbx::cursor::on_last () const
bool mdbx::cursor::on_first_multival () const
bool mdbx::cursor::on_last_multival () const
estimate_result mdbx::cursor::estimate (const slice &key, const slice &value) const
estimate_result mdbx::cursor::estimate (const slice &key) const
estimate_result mdbx::cursor::estimate (move_operation operation) const
estimate_result mdbx::cursor::estimate (move_operation operation, const slice &key) const
void mdbx::cursor::renew (::mdbx::txn &txn)
 Renew/bind a cursor with a new transaction and previously used key-value map handle.
void mdbx::cursor::bind (::mdbx::txn &txn, ::mdbx::map_handle map_handle)
 Bind/renew a cursor with a new transaction and specified key-value map handle.
void mdbx::cursor::unbind ()
 Unbind cursor from a transaction.
inline ::mdbx::txn mdbx::cursor::txn () const
 Returns the cursor's transaction.
map_handle mdbx::cursor::map () const
MDBX_error_t mdbx::cursor::put (const slice &key, slice *value, MDBX_put_flags_t flags) noexcept
void mdbx::cursor::put (const slice &key, slice value, put_mode mode)
void mdbx::cursor::insert (const slice &key, slice value)
value_result mdbx::cursor::try_insert (const slice &key, slice value)
slice mdbx::cursor::insert_reserve (const slice &key, size_t value_length)
value_result mdbx::cursor::try_insert_reserve (const slice &key, size_t value_length)
void mdbx::cursor::upsert (const slice &key, const slice &value)
slice mdbx::cursor::upsert_reserve (const slice &key, size_t value_length)
void mdbx::cursor::update (const slice &key, const slice &value)
bool mdbx::cursor::try_update (const slice &key, const slice &value)
slice mdbx::cursor::update_reserve (const slice &key, size_t value_length)
value_result mdbx::cursor::try_update_reserve (const slice &key, size_t value_length)
bool mdbx::cursor::erase (bool whole_multivalue=false)
 Removes single key-value pair or all multi-values at the current cursor position.
bool mdbx::cursor::erase (const slice &key, bool whole_multivalue=true)
 Seeks and removes first value or whole multi-value of the given key.
bool mdbx::cursor::erase (const slice &key, const slice &value)
 Seeks and removes the particular multi-value entry of the key.
size_t mdbx::cursor::put_multiple_samelength (const slice &key, const size_t value_length, const void *values_array, size_t values_count, put_mode mode, bool allow_partial=false)
static ptrdiff_t mdbx::cursor::distance_between (const cursor from, const cursor to, unsigned deepness=42)
bool mdbx::cursor::scroll (intptr_t distable, unsigned deepness=42, bool throw_notfound=true)
static bool mdbx::cursor::distribute (const cursor from, const cursor to, cursor *cursors_array, intptr_t cursors_array_size, unsigned deepness=42)
static bool mdbx::cursor::distribute (const cursor from, const cursor to, const std::vector< cursor > &cursors, unsigned deepness=42)
static bool mdbx::cursor::distribute (const cursor from, const cursor to, const std::vector< cursor_managed > &cursors, unsigned deepness=42)

Variables

template<class ALLOCATOR = default_allocator, class CAPACITY_POLICY = default_capacity_policy>
class MDBX_MSVC_DECLSPEC_EMPTY_BASES mdbx::buffer

Detailed Description

Macro Definition Documentation

◆ MDBX_CXX_HAS_POLYMORPHIC_ALLOCATOR

#define MDBX_CXX_HAS_POLYMORPHIC_ALLOCATOR   1

Defined as 1 if the mdbx::polymorphic_allocator is available.

See also
The <memory_resource> Standard C++17 library header

◆ MDBX_STD_FILESYSTEM_PATH

#define MDBX_STD_FILESYSTEM_PATH   ::mdbx::filesystem::path

Defined if mdbx::filesystem::path is available.

If defined, it is always mdbx::filesystem::path, which in turn can be refs to std::filesystem::path or std::experimental::filesystem::path. Nonetheless MDBX_STD_FILESYSTEM_PATH not defined if the mdbx::path is fallbacked to c std::string or std::wstring.

Typedef Documentation

◆ buffer_pair

template<typename BUFFER>
using mdbx::buffer_pair = buffer_pair_spec<typename BUFFER::allocator_type, typename BUFFER::reservation_policy>

Combines pair of buffers for key and value to hold an operands for certain operations.

◆ build_info

libmdbx build information

Attention
Some strings could be NULL in case no corresponding information was provided at build time (i.e. flags).

◆ byte

using mdbx::byte = char8_t

The byte-like type that don't presumes aliases for pointers as does the char.

Essentially, to enable all kinds of an compiler optimization, we need just the unsigned char * restrict type in C99 terms, i.e. the non-aliasing pointer to unsigned char. However, C++ still doesn't have restrict keyword not non-aliases type attribute, but a char-pointers may be aliased.

On the other hand, while uint8_t is provided and CHAR_BIT = 8 the char8_t * actually act the same as the C99 unsigned char * restrict. So using char8_t should not be an issue, since both the CHAR_BIT = 8 and uint8_t are required.

At the same time, the approach of using char8_t has several advantages:

  • the restrict attribute is defined on level of the base type and is inherited by any derived pointer type;
  • some compilers treat __restrict as an attribute of an instance of a type (i.e. a variable, a specific pointer), but not a type attribute.

Nonetheless, I should think about switching to the uint8_t * __restrict__ for byte pointers.

Note
Functions whose signature depends on the mdbx::byte type must be strictly defined as inline!

◆ default_allocator

◆ default_buffer

◆ default_buffer_pair

Default pair of buffers.

◆ duration

using mdbx::duration = ::std::chrono::duration<unsigned, ::std::ratio<1, 65536>>

Duration in 1/65536 units of second.

◆ filehandle

◆ legacy_allocator

using mdbx::legacy_allocator = ::std::string::allocator_type

Legacy allocator but it is recommended to use polymorphic_allocator.

◆ path

using mdbx::path = ::mdbx::filesystem::path

◆ path_char

using mdbx::path_char = path_string::value_type

◆ path_string

using mdbx::path_string = ::mdbx::filesystem::path::string_type

◆ polymorphic_allocator

using mdbx::polymorphic_allocator = ::std::pmr::string::allocator_type

Default polymorphic allocator for modern code.

◆ string

template<class ALLOCATOR = default_allocator>
using mdbx::string = ::std::basic_string<char, ::std::char_traits<char>, ALLOCATOR>

Default single-byte string.

◆ txnid

using mdbx::txnid = uint64_t

Transaction ID and MVCC-snapshot number.

◆ version_info

libmdbx version information,

See also
https://semver.org/

Function Documentation

◆ buffer() [1/2]

template<class ALLOCATOR, typename CAPACITY_POLICY>
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( const struct slice & src,
bool make_reference,
const allocator_type & alloc = allocator_type() )
constexpr

◆ buffer() [2/2]

template<class ALLOCATOR, typename CAPACITY_POLICY>
template<class ALLOCATOR, typename CAPACITY_POLICY>
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( const txn & transaction,
const struct slice & src,
const allocator_type & alloc )
inline

◆ cursor() [1/2]

mdbx::cursor::cursor ( cursor && other)
inlinenoexcept

◆ cursor() [2/2]

mdbx::cursor::cursor ( MDBX_cursor * ptr)
constexprnoexcept

◆ env() [1/3]

mdbx::env::env ( env && other)
inlinenoexcept

◆ env() [2/3]

mdbx::env::env ( MDBX_env * ptr)
constexprprotectednoexcept

◆ error()

mdbx::error::error ( MDBX_error_t error_code)
constexprnoexcept

◆ estimate_result()

mdbx::cursor::estimate_result::estimate_result ( const cursor & cursor,
move_operation operation,
const slice & key,
const slice & value )
inline

◆ info()

mdbx::map_handle::info::info ( map_handle::flags flags,
map_handle::state state )
constexprnoexcept

◆ move_result() [1/2]

mdbx::cursor::move_result::move_result ( const cursor & cursor,
bool throw_notfound )
inline

◆ move_result() [2/2]

mdbx::cursor::move_result::move_result ( cursor & cursor,
move_operation operation,
const slice & key,
const slice & value,
bool throw_notfound )
inline

◆ reader_info()

mdbx::env::reader_info::reader_info ( int slot,
mdbx_pid_t pid,
mdbx_tid_t thread,
uint64_t txnid,
uint64_t lag,
size_t used,
size_t retained )
constexprnoexcept

◆ slice() [1/7]

mdbx::slice::slice ( )
constexprnoexcept

Create an empty slice.

◆ slice() [2/7]

mdbx::slice::slice ( const char * c_str)
explicitconstexpr

Create a slice that refers to c_str[0,strlen(c_str)-1].

◆ slice() [3/7]

mdbx::slice::slice ( const MDBX_val & src)
constexpr

◆ slice() [4/7]

mdbx::slice::slice ( const void * begin,
const void * end )
constexpr

Create a slice that refers to [begin,end] of memory bytes.

◆ slice() [5/7]

mdbx::slice::slice ( const void * ptr,
size_t bytes )
constexpr

Create a slice that refers to [0,bytes-1] of memory bytes pointed by ptr.

◆ slice() [6/7]

mdbx::slice::slice ( MDBX_val && src)
constexpr

◆ slice() [7/7]

mdbx::slice::slice ( slice && src)
constexprnoexcept

◆ txn() [1/3]

mdbx::txn::txn ( MDBX_txn * ptr)
constexprprotectednoexcept

◆ txn() [2/3]

mdbx::txn::txn ( txn && other)
inlinenoexcept

◆ ~cursor()

mdbx::cursor::~cursor ( )
inlinenoexcept

◆ ~env()

mdbx::env::~env ( )
inlinenoexcept

◆ ~txn()

mdbx::txn::~txn ( )
inlinenoexcept

◆ alter_flags()

env & mdbx::env::alter_flags ( MDBX_env_flags_t flags,
bool on_off )
inline

Alter environment flags.

◆ append()

void mdbx::txn::append ( map_handle map,
const slice & key,
const slice & value,
bool multivalue_order_preserved = true )
inline

Adding a key-value pair, provided that ascending order of the keys and (optionally) values are preserved.

Instead of splitting the full b+tree pages, the data will be placed on new ones. Thus appending is about two times faster than insertion, and the pages will be filled in completely mostly but not half as after splitting ones. On the other hand, any subsequent insertion or update with an increase in the length of the value will be twice as slow, since it will require splitting already filled pages.

Parameters
[in]mapA map handle to append
[in]keyA key to be append
[in]valueA value to store with the key
[in]multivalue_order_preservedIf multivalue_order_preserved == true then the same rules applied for to pages of nested b+tree of multimap's values.

◆ as_base58_string()

template<class ALLOCATOR>
string< ALLOCATOR > mdbx::slice::as_base58_string ( unsigned wrap_width = 0,
const ALLOCATOR & alloc = ALLOCATOR() ) const
inline

Returns a string with a Base58 dump of the slice content.

◆ as_base64_string()

template<class ALLOCATOR>
string< ALLOCATOR > mdbx::slice::as_base64_string ( unsigned wrap_width = 0,
const ALLOCATOR & alloc = ALLOCATOR() ) const
inline

Returns a string with a Base58 dump of the slice content.

◆ as_buffer() [1/6]

template<class ALLOCATOR, typename CAPACITY_POLICY>
buffer< ALLOCATOR, CAPACITY_POLICY > mdbx::from_base58::as_buffer ( const ALLOCATOR & alloc = ALLOCATOR()) const
inline

Decodes Base58 dump from a passed slice to returned buffer.

◆ as_buffer() [2/6]

template<class ALLOCATOR, typename CAPACITY_POLICY>
buffer< ALLOCATOR, CAPACITY_POLICY > mdbx::from_base64::as_buffer ( const ALLOCATOR & alloc = ALLOCATOR()) const
inline

Decodes Base64 dump from a passed slice to returned buffer.

◆ as_buffer() [3/6]

template<class ALLOCATOR, typename CAPACITY_POLICY>
buffer< ALLOCATOR, CAPACITY_POLICY > mdbx::from_hex::as_buffer ( const ALLOCATOR & alloc = ALLOCATOR()) const
inline

Decodes hexadecimal dump from a passed slice to returned buffer.

◆ as_buffer() [4/6]

template<class ALLOCATOR, typename CAPACITY_POLICY>
buffer< ALLOCATOR, CAPACITY_POLICY > mdbx::to_base58::as_buffer ( const ALLOCATOR & alloc = ALLOCATOR()) const
inline

Returns a buffer with a Base58 dump of a passed slice.

◆ as_buffer() [5/6]

template<class ALLOCATOR, typename CAPACITY_POLICY>
buffer< ALLOCATOR, CAPACITY_POLICY > mdbx::to_base64::as_buffer ( const ALLOCATOR & alloc = ALLOCATOR()) const
inline

Returns a buffer with a Base64 dump of a passed slice.

◆ as_buffer() [6/6]

template<class ALLOCATOR, typename CAPACITY_POLICY>
buffer< ALLOCATOR, CAPACITY_POLICY > mdbx::to_hex::as_buffer ( const ALLOCATOR & alloc = ALLOCATOR()) const
inline

Returns a buffer with a hexadecimal dump of a passed slice.

◆ as_hex_string()

template<class ALLOCATOR>
string< ALLOCATOR > mdbx::slice::as_hex_string ( bool uppercase = false,
unsigned wrap_width = 0,
const ALLOCATOR & alloc = ALLOCATOR() ) const
inline

Returns a string with a hexadecimal dump of the slice content.

◆ as_string() [1/6]

template<class ALLOCATOR>
string< ALLOCATOR > mdbx::from_base58::as_string ( const ALLOCATOR & alloc = ALLOCATOR()) const
inline

Decodes Base58 dump from a passed slice to returned string.

◆ as_string() [2/6]

template<class ALLOCATOR>
string< ALLOCATOR > mdbx::from_base64::as_string ( const ALLOCATOR & alloc = ALLOCATOR()) const
inline

Decodes Base64 dump from a passed slice to returned string.

◆ as_string() [3/6]

template<class ALLOCATOR>
string< ALLOCATOR > mdbx::from_hex::as_string ( const ALLOCATOR & alloc = ALLOCATOR()) const
inline

Decodes hexadecimal dump from a passed slice to returned string.

◆ as_string() [4/6]

template<class ALLOCATOR>
string< ALLOCATOR > mdbx::to_base58::as_string ( const ALLOCATOR & alloc = ALLOCATOR()) const
inline

Returns a string with a Base58 dump of a passed slice.

◆ as_string() [5/6]

template<class ALLOCATOR>
string< ALLOCATOR > mdbx::to_base64::as_string ( const ALLOCATOR & alloc = ALLOCATOR()) const
inline

Returns a string with a Base64 dump of a passed slice.

◆ as_string() [6/6]

template<class ALLOCATOR>
string< ALLOCATOR > mdbx::to_hex::as_string ( const ALLOCATOR & alloc = ALLOCATOR()) const
inline

Returns a string with a hexadecimal dump of a passed slice.

◆ assign() [1/8]

cursor & mdbx::cursor::assign ( const cursor & src)
inline

◆ assign() [2/8]

slice & mdbx::slice::assign ( ::MDBX_val && src)
inline

◆ assign() [3/8]

slice & mdbx::slice::assign ( const ::MDBX_val & src)
inline

◆ assign() [4/8]

slice & mdbx::slice::assign ( const char * c_str)
inline

◆ assign() [5/8]

slice & mdbx::slice::assign ( const slice & src)
inlinenoexcept

◆ assign() [6/8]

slice & mdbx::slice::assign ( const void * begin,
const void * end )
inline

◆ assign() [7/8]

slice & mdbx::slice::assign ( const void * ptr,
size_t bytes )
inline

◆ assign() [8/8]

slice & mdbx::slice::assign ( slice && src)
inlinenoexcept

◆ at()

byte mdbx::slice::at ( size_t n) const
constexpr

Returns the nth byte in the referenced data with bounds checking.

Exceptions
std::out_of_rangeif n >= size()

◆ base58_decode()

template<class ALLOCATOR, class CAPACITY_POLICY>
buffer< ALLOCATOR, CAPACITY_POLICY > mdbx::slice::base58_decode ( bool ignore_spaces = false,
const ALLOCATOR & alloc = ALLOCATOR() ) const
inline

Decodes Base58 dump from the slice content to returned buffer.

◆ base64_decode()

template<class ALLOCATOR, class CAPACITY_POLICY>
buffer< ALLOCATOR, CAPACITY_POLICY > mdbx::slice::base64_decode ( bool ignore_spaces = false,
const ALLOCATOR & alloc = ALLOCATOR() ) const
inline

Decodes Base64 dump from the slice content to returned buffer.

◆ bind()

void mdbx::cursor::bind ( ::mdbx::txn & txn,
::mdbx::map_handle map_handle )
inline

Bind/renew a cursor with a new transaction and specified key-value map handle.

◆ boolean_or_throw() [1/2]

bool mdbx::error::boolean_or_throw ( int error_code)
inlinestatic

◆ boolean_or_throw() [2/2]

bool mdbx::error::boolean_or_throw ( int error_code,
const exception_thunk & thunk )
inlinestatic

◆ byte_ptr() [1/2]

const byte * mdbx::slice::byte_ptr ( ) const
constexprnoexcept

Returns casted to pointer to byte an address of data.

◆ byte_ptr() [2/2]

byte * mdbx::slice::byte_ptr ( )
constexprnoexcept

◆ capture()

void mdbx::exception_thunk::capture ( )
inlinenoexcept

◆ char_ptr() [1/2]

const char * mdbx::slice::char_ptr ( ) const
constexprnoexcept

Returns casted to pointer to char an address of data.

◆ char_ptr() [2/2]

char * mdbx::slice::char_ptr ( )
constexprnoexcept

◆ check_readers()

unsigned mdbx::env::check_readers ( )
inline

Checks for stale readers in the lock table and return number of cleared slots.

◆ clear()

void mdbx::slice::clear ( )
constexprnoexcept

Makes the slice empty and referencing to nothing.

◆ clear_map() [1/2]

bool mdbx::txn::clear_map ( const ::std::string & name,
bool throw_if_absent = false )
inline
Returns
True if the key-value map existed and was cleared, either false if the key-value map did not exist and there is nothing to clear.

◆ clear_map() [2/2]

void mdbx::txn::clear_map ( map_handle map)
inline

Clear key-value map.

◆ clone() [1/2]

void mdbx::txn::clone ( txn_managed & txn_for_renew_into_clone,
void * context = nullptr ) const
inline

Renew given read transaction into clone.

◆ clone() [2/2]

txn_managed mdbx::txn::clone ( void * context = nullptr) const
inline

Clone read transaction.

◆ close_map()

void mdbx::env::close_map ( const map_handle & handle)
inline

Close a key-value map (aka table) handle. Normally unnecessary.

Closing a table handle is not necessary, but lets txn::open_map() reuse the handle value. Usually it's better to set a bigger env::operate_parameters::max_maps, unless that value would be large.

Note
Use with care. This call is synchronized via mutex with other calls close_map(), but NOT with other transactions running by other threads. The "next" version of libmdbx (MithrilDB and Future) will solve this issue.

Handles should only be closed if no other threads are going to reference the table handle or one of its cursors any further. Do not close a handle if an existing transaction has modified its table. Doing so can cause misbehavior from database corruption to errors like MDBX_BAD_DBI (since the DB name is gone).

◆ code()

MDBX_error_t mdbx::error::code ( ) const
constexprnoexcept

Returns error code.

◆ compare_fast() [1/2]

intptr_t mdbx::pair::compare_fast ( const pair & a,
const pair & b )
staticconstexprnoexcept

Three-way fast non-lexicographically length-based comparison.

◆ compare_fast() [2/2]

intptr_t mdbx::slice::compare_fast ( const slice & a,
const slice & b )
staticconstexprnoexcept

Three-way fast non-lexicographically length-based comparison.

Firstly compares length and if it equal then compare content lexicographically.

Returns
value: == 0 if a the same as b; < 0 if a shorter than b, or the same length and lexicographically less than b; > 0 if a longer than b, or the same length and lexicographically great than b.

◆ compare_keys() [1/2]

int mdbx::txn::compare_keys ( map_handle map,
const pair & a,
const pair & b ) const
inlinenoexcept

Compare keys of two pairs according to a particular key-value map (aka table).

◆ compare_keys() [2/2]

int mdbx::txn::compare_keys ( map_handle map,
const slice & a,
const slice & b ) const
inlinenoexcept

Compare two keys according to a particular key-value map (aka table).

◆ compare_lexicographically() [1/2]

intptr_t mdbx::pair::compare_lexicographically ( const pair & a,
const pair & b )
staticconstexprnoexcept

Three-way lexicographically comparison.

◆ compare_lexicographically() [2/2]

intptr_t mdbx::slice::compare_lexicographically ( const slice & a,
const slice & b )
staticconstexprnoexcept

Three-way lexicographically comparison.

Returns
value: == 0 if a lexicographically equal b; < 0 if a lexicographically less than b; > 0 if a lexicographically great than b.

◆ compare_position()

int mdbx::compare_position ( const cursor & left,
const cursor & right,
bool ignore_nested = false )
inline

◆ compare_position_nothrow()

int mdbx::compare_position_nothrow ( const cursor & left,
const cursor & right,
bool ignore_nested = false )
inlinenoexcept

◆ compare_values() [1/2]

int mdbx::txn::compare_values ( map_handle map,
const pair & a,
const pair & b ) const
inlinenoexcept

Compare values of two pairs according to a particular key-value map(aka table).

◆ compare_values() [2/2]

int mdbx::txn::compare_values ( map_handle map,
const slice & a,
const slice & b ) const
inlinenoexcept

Compare two values according to a particular key-value map (aka table).

◆ count_multivalue()

size_t mdbx::cursor::count_multivalue ( ) const
inline

Return count of duplicates for current key.

◆ create_map() [1/3]

map_handle mdbx::txn::create_map ( const ::std::string & name,
const ::mdbx::key_mode key_mode = ::mdbx::key_mode::usual,
const ::mdbx::value_mode value_mode = ::mdbx::value_mode::single )
inline

Create new or open existing key-value map.

◆ create_map() [2/3]

map_handle mdbx::txn::create_map ( const char * name,
const ::mdbx::key_mode key_mode = ::mdbx::key_mode::usual,
const ::mdbx::value_mode value_mode = ::mdbx::value_mode::single )
inline

Create new or open existing key-value map.

◆ create_map() [3/3]

map_handle mdbx::txn::create_map ( const slice & name,
const ::mdbx::key_mode key_mode = ::mdbx::key_mode::usual,
const ::mdbx::value_mode value_mode = ::mdbx::value_mode::single )
inline

Create new or open existing key-value map.

◆ data() [1/2]

const void * mdbx::slice::data ( ) const
constexprnoexcept

Return a pointer to the beginning of the referenced data.

◆ data() [2/2]

void * mdbx::slice::data ( )
constexprnoexcept

◆ dbsize_max()

size_t mdbx::env::limits::dbsize_max ( intptr_t pagesize)
inlinestatic

Returns the maximal database size in bytes for specified page size.

◆ dbsize_min()

size_t mdbx::env::limits::dbsize_min ( intptr_t pagesize)
inlinestatic

Returns the minimal database size in bytes for specified page size.

◆ distance_between()

ptrdiff_t mdbx::cursor::distance_between ( const cursor from,
const cursor to,
unsigned deepness = 42 )
inlinestatic

◆ distribute() [1/3]

bool mdbx::cursor::distribute ( const cursor from,
const cursor to,
const std::vector< cursor > & cursors,
unsigned deepness = 42 )
inlinestatic

◆ distribute() [2/3]

bool mdbx::cursor::distribute ( const cursor from,
const cursor to,
const std::vector< cursor_managed > & cursors,
unsigned deepness = 42 )
inlinestatic

◆ distribute() [3/3]

bool mdbx::cursor::distribute ( const cursor from,
const cursor to,
cursor * cursors_array,
intptr_t cursors_array_size,
unsigned deepness = 42 )
inlinestatic

◆ drop_map() [1/2]

bool mdbx::txn::drop_map ( const ::std::string & name,
bool throw_if_absent = false )
inline

Drop key-value map.

Returns
True if the key-value map existed and was deleted, either false if the key-value map did not exist and there is nothing to delete.

◆ drop_map() [2/2]

void mdbx::txn::drop_map ( map_handle map)
inline

Drops key-value map using handle.

◆ empty()

bool mdbx::slice::empty ( ) const
constexprnoexcept

Checks whether the slice is empty.

◆ encode_base58()

template<class ALLOCATOR, class CAPACITY_POLICY>
buffer< ALLOCATOR, CAPACITY_POLICY > mdbx::slice::encode_base58 ( unsigned wrap_width = 0,
const ALLOCATOR & alloc = ALLOCATOR() ) const
inline

Returns a buffer with a Base58 dump of the slice content.

◆ encode_base64()

template<class ALLOCATOR, class CAPACITY_POLICY>
buffer< ALLOCATOR, CAPACITY_POLICY > mdbx::slice::encode_base64 ( unsigned wrap_width = 0,
const ALLOCATOR & alloc = ALLOCATOR() ) const
inline

Returns a buffer with a Base64 dump of the slice content.

◆ encode_hex()

template<class ALLOCATOR, class CAPACITY_POLICY>
buffer< ALLOCATOR, CAPACITY_POLICY > mdbx::slice::encode_hex ( bool uppercase = false,
unsigned wrap_width = 0,
const ALLOCATOR & alloc = ALLOCATOR() ) const
inline

Returns a buffer with a hexadecimal dump of the slice content.

◆ end() [1/2]

const void * mdbx::slice::end ( ) const
constexprnoexcept

Return a pointer to the ending of the referenced data.

◆ end() [2/2]

void * mdbx::slice::end ( )
constexprnoexcept

◆ end_byte_ptr() [1/2]

const byte * mdbx::slice::end_byte_ptr ( ) const
constexprnoexcept

Returns casted to pointer to byte an end of data.

◆ end_byte_ptr() [2/2]

byte * mdbx::slice::end_byte_ptr ( )
constexprnoexcept

◆ end_char_ptr() [1/2]

const char * mdbx::slice::end_char_ptr ( ) const
constexprnoexcept

Returns casted to pointer to char an end of data.

◆ end_char_ptr() [2/2]

char * mdbx::slice::end_char_ptr ( )
constexprnoexcept

◆ ends_with()

bool mdbx::slice::ends_with ( const slice & suffix) const
constexprnoexcept

Checks if the data ends with the given suffix.

◆ enumerate_readers()

template<typename VISITOR>
int mdbx::env::enumerate_readers ( VISITOR & visitor)
inline

Enumerate readers.

The VISITOR class must have int operator(const reader_info&, int serial) which should return continue_loop (zero) to continue enumeration, or any non-zero value to exit.

Returns
The last value returned from visitor' functor.

◆ env() [3/3]

env mdbx::txn::env ( ) const
inlinenoexcept

Returns the transaction's environment.

◆ eof()

bool mdbx::cursor::eof ( ) const
inline

◆ erase() [1/5]

bool mdbx::cursor::erase ( bool whole_multivalue = false)
inline

Removes single key-value pair or all multi-values at the current cursor position.

◆ erase() [2/5]

bool mdbx::cursor::erase ( const slice & key,
bool whole_multivalue = true )
inline

Seeks and removes first value or whole multi-value of the given key.

Returns
True if the key is found and a value(s) is removed.

◆ erase() [3/5]

bool mdbx::cursor::erase ( const slice & key,
const slice & value )
inline

Seeks and removes the particular multi-value entry of the key.

Returns
True if the given key-value pair is found and removed.

◆ erase() [4/5]

bool mdbx::txn::erase ( map_handle map,
const slice & key )
inline

Removes all values for given key.

◆ erase() [5/5]

bool mdbx::txn::erase ( map_handle map,
const slice & key,
const slice & value )
inline

Removes the particular multi-value entry of the key.

◆ estimate() [1/8]

cursor::estimate_result mdbx::cursor::estimate ( const slice & key) const
inline

◆ estimate() [2/8]

cursor::estimate_result mdbx::cursor::estimate ( const slice & key,
const slice & value ) const
inline

◆ estimate() [3/8]

cursor::estimate_result mdbx::cursor::estimate ( move_operation operation) const
inline

◆ estimate() [4/8]

cursor::estimate_result mdbx::cursor::estimate ( move_operation operation,
const slice & key ) const
inline

◆ estimate() [5/8]

ptrdiff_t mdbx::cursor::estimate ( move_operation operation,
MDBX_val * key,
MDBX_val * value ) const
inlineprotected

◆ estimate() [6/8]

ptrdiff_t mdbx::estimate ( const cursor & from,
const cursor & to )
inline

◆ estimate() [7/8]

ptrdiff_t mdbx::txn::estimate ( map_handle map,
const pair & from,
const pair & to ) const
inline

◆ estimate() [8/8]

ptrdiff_t mdbx::txn::estimate ( map_handle map,
const slice & from,
const slice & to ) const
inline

◆ estimate_from_first()

ptrdiff_t mdbx::txn::estimate_from_first ( map_handle map,
const slice & to ) const
inline

◆ estimate_to_last()

ptrdiff_t mdbx::txn::estimate_to_last ( map_handle map,
const slice & from ) const
inline

◆ extra_option()

uint64_t mdbx::env::extra_option ( enum env::extra_runtime_option option) const
inline

Gets the value of extra runtime options from an environment.

◆ extract()

template<class BUFFER, typename ALLOCATOR>
BUFFER mdbx::txn::extract ( map_handle map,
const slice & key,
const ALLOCATOR & alloc = ALLOCATOR() )
inline

Removes and return a value of the key.

◆ find()

cursor::move_result mdbx::cursor::find ( const slice & key,
bool throw_notfound = true )
inline

◆ find_multivalue()

cursor::move_result mdbx::cursor::find_multivalue ( const slice & key,
const slice & value,
bool throw_notfound = true )
inline

◆ flags()

MDBX_txn_flags_t mdbx::txn::flags ( ) const
inline

Returns transaction's flags.

◆ get() [1/4]

slice mdbx::txn::get ( map_handle map,
const slice & key ) const
inline

Get value by key from a key-value map (aka table).

◆ get() [2/4]

slice mdbx::txn::get ( map_handle map,
const slice & key,
const slice & value_at_absence ) const
inline

Get value by key from a key-value map (aka table).

◆ get() [3/4]

slice mdbx::txn::get ( map_handle map,
slice key,
size_t & values_count ) const
inline

Get first of multi-value and values count by key from a key-value multimap (aka table).

◆ get() [4/4]

slice mdbx::txn::get ( map_handle map,
slice key,
size_t & values_count,
const slice & value_at_absence ) const
inline

Get first of multi-value and values count by key from a key-value multimap (aka table).

◆ get_build()

const build_info & mdbx::get_build ( )
constexprnoexcept

Returns libmdbx build information.

◆ get_canary()

txn::canary mdbx::txn::get_canary ( ) const
inline

Returns fours integers markers (aka "canary") associated with the environment.

◆ get_context() [1/3]

void * mdbx::cursor::get_context ( ) const
inlinenoexcept

Returns the application context associated with the cursor.

◆ get_context() [2/3]

void * mdbx::env::get_context ( ) const
inlinenoexcept

Returns the application context associated with the environment.

◆ get_context() [3/3]

void * mdbx::txn::get_context ( ) const
inlinenoexcept

Returns the application context associated with the transaction.

◆ get_durability()

env::durability mdbx::env::get_durability ( ) const
inline

Returns current durability mode.

◆ get_equal_or_great() [1/2]

pair_result mdbx::txn::get_equal_or_great ( map_handle map,
const slice & key ) const
inline

Get value for equal or great key from a table.

Returns
Bundle of key-value pair and boolean flag, which will be true if the exact key was found and false otherwise.

◆ get_equal_or_great() [2/2]

pair_result mdbx::txn::get_equal_or_great ( map_handle map,
const slice & key,
const slice & value_at_absence ) const
inline

Get value for equal or great key from a table.

Returns
Bundle of key-value pair and boolean flag, which will be true if the exact key was found and false otherwise.

◆ get_filehandle()

filehandle mdbx::env::get_filehandle ( ) const
inline

Returns the file descriptor for the DXB file of MDBX environment.

◆ get_flags()

MDBX_env_flags_t mdbx::env::get_flags ( ) const
inline

Returns environment flags.

◆ get_HandleSlowReaders()

MDBX_hsr_func mdbx::env::get_HandleSlowReaders ( ) const
inlinenoexcept

Returns the current Handle-Slow-Readers callback used to resolve database full/overflow issue due to a reader(s) which prevents the old data from being recycled.

See also
set_HandleSlowReaders()

◆ get_info() [1/3]

env::info mdbx::env::get_info ( ) const
inline

Return snapshot information about the MDBX environment.

◆ get_info() [2/3]

env::info mdbx::env::get_info ( const txn & txn) const
inline

Return information about the MDBX environment accordingly to the specified transaction.

◆ get_info() [3/3]

txn::info mdbx::txn::get_info ( bool scan_reader_lock_table = false) const
inline

Returns information about the MDBX transaction.

◆ get_map_flags()

map_handle::info mdbx::txn::get_map_flags ( map_handle map) const
inline

Returns information about key-value map (aka table) handle.

◆ get_map_stat()

txn::map_stat mdbx::txn::get_map_stat ( map_handle map) const
inline

Returns statistics for a table.

◆ get_mode()

env::mode mdbx::env::get_mode ( ) const
inline

Returns current operation mode.

◆ get_operation_parameters()

env::operate_parameters mdbx::env::get_operation_parameters ( ) const
inline

Returns current operation parameters.

◆ get_options()

env::operate_options mdbx::env::get_options ( ) const
inline

Returns current operate options.

◆ get_reclaiming()

env::reclaiming_options mdbx::env::get_reclaiming ( ) const
inline

Returns current reclaiming options.

◆ get_stat() [1/2]

env::stat mdbx::env::get_stat ( ) const
inline

Returns snapshot statistics about the MDBX environment.

◆ get_stat() [2/2]

env::stat mdbx::env::get_stat ( const txn & txn) const
inline

Return statistics about the MDBX environment accordingly to the specified transaction.

◆ get_tree_deepmask()

uint32_t mdbx::txn::get_tree_deepmask ( map_handle map) const
inline

Returns depth (bitmask) information of nested dupsort (multi-value) B+trees for given table.

◆ get_version()

const version_info & mdbx::get_version ( )
constexprnoexcept

Returns libmdbx version information.

◆ hash_value()

size_t mdbx::slice::hash_value ( ) const
constexprnoexcept

Returns the hash value of referenced data.

Attention
Function implementation and returned hash values may changed version to version, and in future the t1ha3 will be used here. Therefore values obtained from this function shouldn't be persisted anywhere.

◆ head()

slice mdbx::slice::head ( size_t n) const
constexprnoexcept

Returns the first "n" bytes of the slice.

Precondition
REQUIRES: n <= size()

◆ hex_decode()

template<class ALLOCATOR, class CAPACITY_POLICY>
buffer< ALLOCATOR, CAPACITY_POLICY > mdbx::slice::hex_decode ( bool ignore_spaces = false,
const ALLOCATOR & alloc = ALLOCATOR() ) const
inline

Decodes hexadecimal dump from the slice content to returned buffer.

◆ id()

uint64_t mdbx::txn::id ( ) const
inline

Return the transaction's ID.

◆ insert() [1/2]

void mdbx::cursor::insert ( const slice & key,
slice value )
inline

◆ insert() [2/2]

void mdbx::txn::insert ( map_handle map,
const slice & key,
slice value )
inline

◆ insert_reserve() [1/2]

slice mdbx::cursor::insert_reserve ( const slice & key,
size_t value_length )
inline

◆ insert_reserve() [2/2]

slice mdbx::txn::insert_reserve ( map_handle map,
const slice & key,
size_t value_length )
inline

◆ invalidate()

void mdbx::slice::invalidate ( )
constexprnoexcept

Depletes content of slice and make it invalid.

◆ is_base58()

bool mdbx::slice::is_base58 ( bool ignore_spaces = false) const
inlinenoexcept

Checks whether the content of the slice is a Base58 dump.

Parameters
[in]ignore_spacesIf true function will skips spaces surrounding (before, between and after) a encoded bytes. However, spaces should not break a code group of characters.

◆ is_base64()

bool mdbx::slice::is_base64 ( bool ignore_spaces = false) const
inlinenoexcept

Checks whether the content of the slice is a Base64 dump.

Parameters
[in]ignore_spacesIf true function will skips spaces surrounding (before, between and after) a encoded bytes. However, spaces should not break a code group of characters.

◆ is_clean()

bool mdbx::exception_thunk::is_clean ( ) const
inlinenoexcept

◆ is_dirty()

bool mdbx::txn::is_dirty ( const void * ptr) const
inline

Checks whether the given data is on a dirty page.

◆ is_failure()

bool mdbx::error::is_failure ( ) const
constexprnoexcept

◆ is_hex()

bool mdbx::slice::is_hex ( bool ignore_spaces = false) const
inlinenoexcept

Checks whether the content of the slice is a hexadecimal dump.

Parameters
[in]ignore_spacesIf true function will skips spaces surrounding (before, between and after) a encoded bytes. However, spaces should not break a pair of characters encoding a single byte.

◆ is_mdbx_error()

bool mdbx::error::is_mdbx_error ( ) const
constexprnoexcept

Returns true for MDBX's errors.

◆ is_null()

bool mdbx::slice::is_null ( ) const
constexprnoexcept

Checks whether the slice data pointer is nullptr.

◆ is_result_false()

bool mdbx::error::is_result_false ( ) const
constexprnoexcept

◆ is_result_true()

bool mdbx::error::is_result_true ( ) const
constexprnoexcept

◆ is_success()

bool mdbx::error::is_success ( ) const
constexprnoexcept

◆ key_max() [1/4]

size_t mdbx::env::limits::key_max ( const env & env,
key_mode mode )
inlinestatic

Returns the maximal key size in bytes for given environment and keys mode.

◆ key_max() [2/4]

size_t mdbx::env::limits::key_max ( const env & env,
MDBX_db_flags_t flags )
inlinestatic

Returns the maximal key size in bytes for given environment and table flags.

◆ key_max() [3/4]

size_t mdbx::env::limits::key_max ( intptr_t pagesize,
key_mode mode )
inlinestatic

Returns the maximal key size in bytes for specified page size and keys mode.

◆ key_max() [4/4]

size_t mdbx::env::limits::key_max ( intptr_t pagesize,
MDBX_db_flags_t flags )
inlinestatic

Returns the maximal key size in bytes for specified page size and table flags.

◆ key_min() [1/2]

size_t mdbx::env::limits::key_min ( key_mode mode)
inlinestaticnoexcept

Returns the minimal key size in bytes for specified keys mode.

◆ key_min() [2/2]

size_t mdbx::env::limits::key_min ( MDBX_db_flags_t flags)
inlinestaticnoexcept

Returns the minimal key size in bytes for specified table flags.

◆ key_mode()

MDBX_CXX11_CONSTEXPR_ENUM mdbx::key_mode mdbx::map_handle::info::key_mode ( ) const
noexcept

◆ length()

size_t mdbx::slice::length ( ) const
constexprnoexcept

Returns the number of bytes.

◆ lower_bound()

cursor::move_result mdbx::cursor::lower_bound ( const slice & key,
bool throw_notfound = false )
inline

◆ lower_bound_multivalue()

cursor::move_result mdbx::cursor::lower_bound_multivalue ( const slice & key,
const slice & value,
bool throw_notfound = false )
inline

◆ make_broken()

void mdbx::txn::make_broken ( )
inline

Marks transaction as broken to prevent further operations.

◆ make_buffer() [1/2]

template<class ALLOCATOR, class CAPACITY_POLICY, ImmutableByteProducer PRODUCER>
buffer< ALLOCATOR, CAPACITY_POLICY > mdbx::make_buffer ( const PRODUCER & producer,
const ALLOCATOR & alloc )
inline

◆ make_buffer() [2/2]

template<class ALLOCATOR, class CAPACITY_POLICY, MutableByteProducer PRODUCER>
buffer< ALLOCATOR, CAPACITY_POLICY > mdbx::make_buffer ( PRODUCER & producer,
const ALLOCATOR & alloc )
inline

◆ make_dynamic()

env::geometry & mdbx::env::geometry::make_dynamic ( intptr_t lower = default_value,
intptr_t upper = default_value )
inlinenoexcept

◆ make_fixed()

env::geometry & mdbx::env::geometry::make_fixed ( intptr_t size)
inlinenoexcept

◆ make_string() [1/2]

template<class ALLOCATOR, ImmutableByteProducer PRODUCER>
string< ALLOCATOR > mdbx::make_string ( const PRODUCER & producer,
const ALLOCATOR & alloc )
inline

◆ make_string() [2/2]

template<class ALLOCATOR, MutableByteProducer PRODUCER>
string< ALLOCATOR > mdbx::make_string ( PRODUCER & producer,
const ALLOCATOR & alloc )
inline

◆ map()

map_handle mdbx::cursor::map ( ) const
inline

◆ max_map_handles()

size_t mdbx::env::limits::max_map_handles ( void )
inlinestatic

Returns the maximum opened map handles, aka DBI-handles.

◆ max_maps()

unsigned mdbx::env::max_maps ( ) const
inline

Returns the maximum number of named tables for the environment.

See also
extra_runtime_option::max_maps

◆ max_readers()

unsigned mdbx::env::max_readers ( ) const
inline

Returns the maximum number of threads/reader slots for the environment.

See also
extra_runtime_option::max_readers

◆ MDBX_EXTERN_API_TEMPLATE() [1/2]

mdbx::MDBX_EXTERN_API_TEMPLATE ( LIBMDBX_API_TYPE ,
buffer< legacy_allocator, default_capacity_policy >  )

◆ MDBX_EXTERN_API_TEMPLATE() [2/2]

mdbx::MDBX_EXTERN_API_TEMPLATE ( LIBMDBX_API_TYPE ,
buffer< polymorphic_allocator, default_capacity_policy >  )

◆ middle()

slice mdbx::slice::middle ( size_t from,
size_t n ) const
constexprnoexcept

Returns the middle "n" bytes of the slice.

Precondition
REQUIRES: from + n <= size()

◆ move()

bool mdbx::cursor::move ( move_operation operation,
MDBX_val * key,
MDBX_val * value,
bool throw_notfound ) const
inlineprotected

◆ on_first()

bool mdbx::cursor::on_first ( ) const
inline

◆ on_first_multival()

bool mdbx::cursor::on_first_multival ( ) const
inline

◆ on_last()

bool mdbx::cursor::on_last ( ) const
inline

◆ on_last_multival()

bool mdbx::cursor::on_last_multival ( ) const
inline

◆ open_cursor()

cursor_managed mdbx::txn::open_cursor ( map_handle map) const
inline

Opens cursor for specified key-value map handle.

◆ open_map() [1/3]

map_handle mdbx::txn::open_map ( const ::std::string & name,
const ::mdbx::key_mode key_mode = ::mdbx::key_mode::usual,
const ::mdbx::value_mode value_mode = ::mdbx::value_mode::single ) const
inline

Open existing key-value map.

◆ open_map() [2/3]

map_handle mdbx::txn::open_map ( const char * name,
const ::mdbx::key_mode key_mode = ::mdbx::key_mode::usual,
const ::mdbx::value_mode value_mode = ::mdbx::value_mode::single ) const
inline

Open existing key-value map.

◆ open_map() [3/3]

map_handle mdbx::txn::open_map ( const slice & name,
const ::mdbx::key_mode key_mode = ::mdbx::key_mode::usual,
const ::mdbx::value_mode value_mode = ::mdbx::value_mode::single ) const
inline

Open existing key-value map.

◆ open_map_accede() [1/3]

map_handle mdbx::txn::open_map_accede ( const ::std::string & name) const
inline

Open existing key-value map.

◆ open_map_accede() [2/3]

map_handle mdbx::txn::open_map_accede ( const char * name) const
inline

Open existing key-value map.

◆ open_map_accede() [3/3]

map_handle mdbx::txn::open_map_accede ( const slice & name) const
inline

Open existing key-value map.

◆ operator!=() [1/3]

bool mdbx::operator!= ( const error & a,
const error & b )
constexprnoexcept

◆ operator!=() [2/3]

bool mdbx::operator!= ( const pair & a,
const pair & b )
constexprnoexcept

◆ operator!=() [3/3]

bool mdbx::operator!= ( const slice & a,
const slice & b )
constexprnoexcept

◆ operator<() [1/2]

bool mdbx::operator< ( const pair & a,
const pair & b )
constexprnoexcept

◆ operator<() [2/2]

bool mdbx::operator< ( const slice & a,
const slice & b )
constexprnoexcept

◆ operator<<() [1/19]

LIBMDBX_API::std::ostream & mdbx::operator<< ( ::std::ostream & ,
const env::durability &  )

◆ operator<<() [2/19]

LIBMDBX_API::std::ostream & mdbx::operator<< ( ::std::ostream & ,
const env::geometry &  )

◆ operator<<() [3/19]

LIBMDBX_API::std::ostream & mdbx::operator<< ( ::std::ostream & ,
const env::geometry::size &  )

◆ operator<<() [4/19]

LIBMDBX_API::std::ostream & mdbx::operator<< ( ::std::ostream & ,
const env::mode &  )

◆ operator<<() [5/19]

LIBMDBX_API::std::ostream & mdbx::operator<< ( ::std::ostream & ,
const env::operate_options &  )

◆ operator<<() [6/19]

LIBMDBX_API::std::ostream & mdbx::operator<< ( ::std::ostream & ,
const env::operate_parameters &  )

◆ operator<<() [7/19]

LIBMDBX_API::std::ostream & mdbx::operator<< ( ::std::ostream & ,
const env::reclaiming_options &  )

◆ operator<<() [8/19]

LIBMDBX_API::std::ostream & mdbx::operator<< ( ::std::ostream & ,
const env_managed::create_parameters &  )

◆ operator<<() [9/19]

LIBMDBX_API::std::ostream & mdbx::operator<< ( ::std::ostream & ,
const error &  )

◆ operator<<() [10/19]

LIBMDBX_API::std::ostream & mdbx::operator<< ( ::std::ostream & ,
const MDBX_debug_flags_t &  )

◆ operator<<() [11/19]

LIBMDBX_API::std::ostream & mdbx::operator<< ( ::std::ostream & ,
const MDBX_log_level_t &  )

◆ operator<<() [12/19]

LIBMDBX_API::std::ostream & mdbx::operator<< ( ::std::ostream & ,
const pair &  )

◆ operator<<() [13/19]

LIBMDBX_API::std::ostream & mdbx::operator<< ( ::std::ostream & ,
const pair_result &  )

◆ operator<<() [14/19]

LIBMDBX_API::std::ostream & mdbx::operator<< ( ::std::ostream & ,
const slice &  )

◆ operator<<() [15/19]

template<class ALLOCATOR, typename CAPACITY_POLICY>
inline ::std::ostream & mdbx::operator<< ( ::std::ostream & out,
const buffer< ALLOCATOR, CAPACITY_POLICY > & it )

◆ operator<<() [16/19]

inline ::std::ostream & mdbx::operator<< ( ::std::ostream & out,
const MDBX_error_t & errcode )

◆ operator<<() [17/19]

inline ::std::ostream & mdbx::operator<< ( ::std::ostream & out,
const to_base58 & wrapper )

◆ operator<<() [18/19]

inline ::std::ostream & mdbx::operator<< ( ::std::ostream & out,
const to_base64 & wrapper )

◆ operator<<() [19/19]

inline ::std::ostream & mdbx::operator<< ( ::std::ostream & out,
const to_hex & wrapper )

◆ operator<=() [1/2]

bool mdbx::operator<= ( const pair & a,
const pair & b )
constexprnoexcept

◆ operator<=() [2/2]

bool mdbx::operator<= ( const slice & a,
const slice & b )
constexprnoexcept

◆ operator=() [1/5]

cursor & mdbx::cursor::operator= ( cursor && other)
inlinenoexcept

◆ operator=() [2/5]

env & mdbx::env::operator= ( env && other)
inlinenoexcept

◆ operator=() [3/5]

slice & mdbx::slice::operator= ( ::MDBX_val && src)
inline

◆ operator=() [4/5]

slice & mdbx::slice::operator= ( slice && src)
inlinenoexcept

◆ operator=() [5/5]

txn & mdbx::txn::operator= ( txn && other)
inlinenoexcept

◆ operator==() [1/3]

bool mdbx::operator== ( const error & a,
const error & b )
constexprnoexcept

◆ operator==() [2/3]

bool mdbx::operator== ( const pair & a,
const pair & b )
constexprnoexcept

◆ operator==() [3/3]

bool mdbx::operator== ( const slice & a,
const slice & b )
constexprnoexcept

◆ operator>() [1/2]

bool mdbx::operator> ( const pair & a,
const pair & b )
constexprnoexcept

◆ operator>() [2/2]

bool mdbx::operator> ( const slice & a,
const slice & b )
constexprnoexcept

◆ operator>=() [1/2]

bool mdbx::operator>= ( const pair & a,
const pair & b )
constexprnoexcept

◆ operator>=() [2/2]

bool mdbx::operator>= ( const slice & a,
const slice & b )
constexprnoexcept

◆ operator[]()

byte mdbx::slice::operator[] ( size_t n) const
constexprnoexcept

Returns the nth byte in the referenced data.

Precondition
REQUIRES: n < size()

◆ options_from_flags()

env::operate_options mdbx::env::operate_parameters::options_from_flags ( MDBX_env_flags_t flags)
inlinestaticnoexcept

◆ pagesize_max()

size_t mdbx::env::limits::pagesize_max ( )
inlinestaticnoexcept

Returns the maximal database page size in bytes.

◆ pagesize_min()

size_t mdbx::env::limits::pagesize_min ( )
inlinestaticnoexcept

Returns the minimal database page size in bytes.

◆ pairsize4page_max() [1/4]

size_t mdbx::env::limits::pairsize4page_max ( const env & env,
MDBX_db_flags_t flags )
inlinestatic

Returns maximal size of key-value pair to fit in a single page for given environment and table flags.

◆ pairsize4page_max() [2/4]

size_t mdbx::env::limits::pairsize4page_max ( const env & env,
value_mode mode )
inlinestatic

Returns maximal size of key-value pair to fit in a single page for specified page size and values mode.

◆ pairsize4page_max() [3/4]

size_t mdbx::env::limits::pairsize4page_max ( intptr_t pagesize,
MDBX_db_flags_t flags )
inlinestatic

Returns maximal size of key-value pair to fit in a single page for specified size and table flags.

◆ pairsize4page_max() [4/4]

size_t mdbx::env::limits::pairsize4page_max ( intptr_t pagesize,
value_mode mode )
inlinestatic

Returns maximal size of key-value pair to fit in a single page for specified page size and values mode.

◆ park_reading()

void mdbx::txn::park_reading ( bool autounpark = true)
inline

Park read-only transaction.

◆ prepare_read()

txn_managed mdbx::env::prepare_read ( ) const
inline

Creates but not start read transaction.

◆ put() [1/4]

MDBX_error_t mdbx::cursor::put ( const slice & key,
slice * value,
MDBX_put_flags_t flags )
inlinenoexcept

◆ put() [2/4]

void mdbx::cursor::put ( const slice & key,
slice value,
put_mode mode )
inline

◆ put() [3/4]

MDBX_error_t mdbx::txn::put ( map_handle map,
const slice & key,
slice * value,
MDBX_put_flags_t flags )
inlinenoexcept

◆ put() [4/4]

void mdbx::txn::put ( map_handle map,
const slice & key,
slice value,
put_mode mode )
inline

◆ put_canary()

txn & mdbx::txn::put_canary ( const canary & canary)
inline

Set integers markers (aka "canary") associated with the environment.

◆ put_multiple_samelength() [1/2]

size_t mdbx::cursor::put_multiple_samelength ( const slice & key,
const size_t value_length,
const void * values_array,
size_t values_count,
put_mode mode,
bool allow_partial = false )
inline

◆ put_multiple_samelength() [2/2]

size_t mdbx::txn::put_multiple_samelength ( map_handle map,
const slice & key,
const size_t value_length,
const void * values_array,
size_t values_count,
put_mode mode,
bool allow_partial = false )
inline

◆ reclaiming_from_flags()

env::reclaiming_options mdbx::env::operate_parameters::reclaiming_from_flags ( MDBX_env_flags_t flags)
inlinestaticnoexcept

◆ release_all_cursors()

size_t mdbx::txn::release_all_cursors ( bool unbind) const
inline

Unbind or close all cursors.

◆ remove_prefix()

void mdbx::slice::remove_prefix ( size_t n)
inlinenoexcept

Drops the first "n" bytes from this slice.

Precondition
REQUIRES: n <= size()

◆ remove_suffix()

void mdbx::slice::remove_suffix ( size_t n)
inlinenoexcept

Drops the last "n" bytes from this slice.

Precondition
REQUIRES: n <= size()

◆ rename_map() [1/3]

void mdbx::txn::rename_map ( map_handle map,
const ::std::string & new_name )
inline

Переименовывает таблицу ключ-значение.

◆ rename_map() [2/3]

void mdbx::txn::rename_map ( map_handle map,
const char * new_name )
inline

Переименовывает таблицу ключ-значение.

◆ rename_map() [3/3]

void mdbx::txn::rename_map ( map_handle map,
const slice & new_name )
inline

Переименовывает таблицу ключ-значение.

◆ renew()

void mdbx::cursor::renew ( ::mdbx::txn & txn)
inline

Renew/bind a cursor with a new transaction and previously used key-value map handle.

◆ renew_reading()

void mdbx::txn::renew_reading ( )
inline

Renew read-only transaction.

◆ replace() [1/2]

template<class BUFFER, typename ALLOCATOR>
BUFFER mdbx::txn::replace ( map_handle map,
const slice & key,
const slice & new_value,
const ALLOCATOR & alloc = ALLOCATOR() )
inline

Replaces and returns a value of the key with new one.

◆ replace() [2/2]

void mdbx::txn::replace ( map_handle map,
const slice & key,
slice & old_value,
const slice & new_value )
inline

Replaces the particular multi-value of the key with a new value.

◆ replace_reserve()

template<class BUFFER, typename ALLOCATOR>
BUFFER mdbx::txn::replace_reserve ( map_handle map,
const slice & key,
size_t length,
slice & new_value_reservation,
const ALLOCATOR & alloc = ALLOCATOR() )
inline

◆ reset_reading()

void mdbx::txn::reset_reading ( )
inline

Reset read-only transaction.

◆ rethrow_captured()

void mdbx::exception_thunk::rethrow_captured ( ) const
inline

◆ safe_head()

slice mdbx::slice::safe_head ( size_t n) const
constexpr

Returns the first "n" bytes of the slice.

Exceptions
std::out_of_rangeif n >= size()

◆ safe_middle()

slice mdbx::slice::safe_middle ( size_t from,
size_t n ) const
constexpr

Returns the middle "n" bytes of the slice.

Exceptions
std::out_of_rangeif from + n >= size()

◆ safe_remove_prefix()

void mdbx::slice::safe_remove_prefix ( size_t n)
inline

Drops the first "n" bytes from this slice.

Exceptions
std::out_of_rangeif n > size()

◆ safe_remove_suffix()

void mdbx::slice::safe_remove_suffix ( size_t n)
inline

Drops the last "n" bytes from this slice.

Exceptions
std::out_of_rangeif n > size()

◆ safe_tail()

slice mdbx::slice::safe_tail ( size_t n) const
constexpr

Returns the last "n" bytes of the slice.

Exceptions
std::out_of_rangeif n >= size()

◆ scroll()

bool mdbx::cursor::scroll ( intptr_t distable,
unsigned deepness = 42,
bool throw_notfound = true )
inline

◆ seek()

bool mdbx::cursor::seek ( const slice & key)
inline

◆ sequence() [1/2]

uint64_t mdbx::txn::sequence ( map_handle map) const
inline

Reads sequence generator associated with a key-value map (aka table).

◆ sequence() [2/2]

uint64_t mdbx::txn::sequence ( map_handle map,
uint64_t increment )
inline

Reads and increment sequence generator associated with a key-value map (aka table).

◆ set_context() [1/3]

cursor & mdbx::cursor::set_context ( void * your_context)
inline

Sets the application context associated with the cursor.

◆ set_context() [2/3]

env & mdbx::env::set_context ( void * your_context)
inline

Sets the application context associated with the environment.

◆ set_context() [3/3]

txn & mdbx::txn::set_context ( void * your_context)
inline

Sets the application context associated with the transaction.

◆ set_end()

slice & mdbx::slice::set_end ( const void * ptr)
constexpr

Sets the length by specifying the end of the slice data.

◆ set_extra_option()

env & mdbx::env::set_extra_option ( enum env::extra_runtime_option option,
uint64_t value )
inline

Sets the value of a extra runtime options for an environment.

◆ set_geometry()

env & mdbx::env::set_geometry ( const geometry & size)
inline

Set all size-related parameters of environment.

◆ set_HandleSlowReaders()

env & mdbx::env::set_HandleSlowReaders ( MDBX_hsr_func cb)
inline

Sets a Handle-Slow-Readers callback to resolve database full/overflow issue due to a reader(s) which prevents the old data from being recycled.

Such callback will be triggered in a case where there is not enough free space in the database due to long read transaction(s) which impedes reusing the pages of an old MVCC snapshot(s).

Using this callback you can choose how to resolve the situation:

  • abort the write transaction with an error;
  • wait for the read transaction(s) to complete;
  • notify a thread performing a long-lived read transaction and wait for an effect;
  • kill the thread or whole process that performs the long-lived read transaction;
See also
long-lived-read

◆ set_length()

slice & mdbx::slice::set_length ( size_t bytes)
constexpr

Set slice length.

◆ set_sync_period__seconds_16dot16()

env & mdbx::env::set_sync_period__seconds_16dot16 ( unsigned seconds_16dot16)
inline

Sets relative period since the last unsteady commit to force flush the data buffers to disk, for non-sync durability modes.

The relative period value affects all processes which operates with given environment until the last process close environment or a new value will be settled. Data is always written to disk when txn_managed::commit() is called, but the operating system may keep it buffered. MDBX always flushes the OS buffers upon commit as well, unless the environment was opened with whole_fragile, lazy_weak_tail or in part half_synchronous_weak_last. Settled period don't checked asynchronously, but only by the txn_managed::commit() and env::sync_to_disk() functions. Therefore, in cases where transactions are committed infrequently and/or irregularly, polling by env::poll_sync_to_disk() may be a reasonable solution to timeout enforcement.

The default is 0, than mean no any timeout checked, and no additional flush will be made.

See also
extra_runtime_option::sync_period
Parameters
[in]seconds_16dot16The period in 1/65536 of second when a synchronous flush would be made since the last unsteady commit.

◆ set_sync_period__seconds_double()

env & mdbx::env::set_sync_period__seconds_double ( double seconds)
inline

Sets relative period since the last unsteady commit to force flush the data buffers to disk, for non-sync durability modes.

The relative period value affects all processes which operates with given environment until the last process close environment or a new value will be settled. Data is always written to disk when txn_managed::commit() is called, but the operating system may keep it buffered. MDBX always flushes the OS buffers upon commit as well, unless the environment was opened with whole_fragile, lazy_weak_tail or in part half_synchronous_weak_last. Settled period don't checked asynchronously, but only by the txn_managed::commit() and env::sync_to_disk() functions. Therefore, in cases where transactions are committed infrequently and/or irregularly, polling by env::poll_sync_to_disk() may be a reasonable solution to timeout enforcement.

The default is 0, than mean no any timeout checked, and no additional flush will be made.

See also
extra_runtime_option::sync_period
Parameters
[in]secondsThe period in second when a synchronous flush would be made since the last unsteady commit.

◆ set_sync_threshold()

env & mdbx::env::set_sync_threshold ( size_t bytes)
inline

Sets threshold to force flush the data buffers to disk, for non-sync durability modes.

The threshold value affects all processes which operates with given environment until the last process close environment or a new value will be settled. Data is always written to disk when txn_managed::commit() is called, but the operating system may keep it buffered. MDBX always flushes the OS buffers upon commit as well, unless the environment was opened with whole_fragile, lazy_weak_tail or in part half_synchronous_weak_last.

The default is 0, than mean no any threshold checked, and no additional flush will be made.

See also
extra_runtime_option::sync_bytes

◆ size()

size_t mdbx::slice::size ( ) const
constexprnoexcept

Returns the number of bytes.

◆ start_read()

txn_managed mdbx::env::start_read ( ) const
inline

Starts read (read-only) transaction.

◆ start_write() [1/2]

txn_managed mdbx::env::start_write ( bool dont_wait = false)
inline

Starts write (read-write) transaction.

◆ start_write() [2/2]

txn_managed mdbx::env::start_write ( txn & parent)
inline

Starts write (read-write) transaction.

◆ starts_with()

bool mdbx::slice::starts_with ( const slice & prefix) const
constexprnoexcept

Checks if the data starts with the given prefix.

◆ success_or_throw() [1/4]

void mdbx::error::success_or_throw ( ) const
inline

◆ success_or_throw() [2/4]

void mdbx::error::success_or_throw ( const exception_thunk & thunk) const
inline

◆ success_or_throw() [3/4]

void mdbx::error::success_or_throw ( int error_code,
const exception_thunk & thunk )
inlinestatic

◆ success_or_throw() [4/4]

void mdbx::error::success_or_throw ( MDBX_error_t error_code)
inlinestatic

◆ sync_period__seconds_16dot16()

unsigned mdbx::env::sync_period__seconds_16dot16 ( ) const
inline

Gets relative period since the last unsteady commit that used to force flush the data buffers to disk, for non-sync durability modes.

The relative period value affects all processes which operates with given environment until the last process close environment or a new value will be settled. Data is always written to disk when txn_managed::commit() is called, but the operating system may keep it buffered. MDBX always flushes the OS buffers upon commit as well, unless the environment was opened with whole_fragile, lazy_weak_tail or in part half_synchronous_weak_last. Settled period don't checked asynchronously, but only by the txn_managed::commit() and env::sync_to_disk() functions. Therefore, in cases where transactions are committed infrequently and/or irregularly, polling by env::poll_sync_to_disk() may be a reasonable solution to timeout enforcement.

The default is 0, than mean no any timeout checked, and no additional flush will be made.

See also
extra_runtime_option::sync_period
set_sync_period(const duration&)
extra_runtime_option::sync_period
sync_period__seconds_16dot16(unsigned)

◆ sync_period__seconds_double()

double mdbx::env::sync_period__seconds_double ( ) const
inline

Gets relative period since the last unsteady commit that used to force flush the data buffers to disk, for non-sync durability modes.

The relative period value affects all processes which operates with given environment until the last process close environment or a new value will be settled. Data is always written to disk when txn_managed::commit() is called, but the operating system may keep it buffered. MDBX always flushes the OS buffers upon commit as well, unless the environment was opened with whole_fragile, lazy_weak_tail or in part half_synchronous_weak_last. Settled period don't checked asynchronously, but only by the txn_managed::commit() and env::sync_to_disk() functions. Therefore, in cases where transactions are committed infrequently and/or irregularly, polling by env::poll_sync_to_disk() may be a reasonable solution to timeout enforcement.

The default is 0, than mean no any timeout checked, and no additional flush will be made.

See also
extra_runtime_option::sync_period
set_sync_period(const duration&)
extra_runtime_option::sync_period
set_sync_period__seconds_double(double)

◆ sync_threshold()

size_t mdbx::env::sync_threshold ( ) const
inline

Gets threshold used to force flush the data buffers to disk, for non-sync durability modes.

The threshold value affects all processes which operates with given environment until the last process close environment or a new value will be settled. Data is always written to disk when txn_managed::commit() is called, but the operating system may keep it buffered. MDBX always flushes the OS buffers upon commit as well, unless the environment was opened with whole_fragile, lazy_weak_tail or in part half_synchronous_weak_last.

The default is 0, than mean no any threshold checked, and no additional flush will be made.

See also
extra_runtime_option::sync_bytes
extra_runtime_option::sync_bytes

◆ sync_to_disk()

bool mdbx::env::sync_to_disk ( bool force = true,
bool nonblock = false )
inline

Flush the environment data buffers.

Returns
True if sync done or no data to sync, or false if the environment is busy by other thread or none of the thresholds are reached.

◆ tail()

slice mdbx::slice::tail ( size_t n) const
constexprnoexcept

Returns the last "n" bytes of the slice.

Precondition
REQUIRES: n <= size()

◆ throw_exception()

void mdbx::error::throw_exception ( int error_code)
inlinestatic

◆ throw_on_failure() [1/2]

void mdbx::error::throw_on_failure ( ) const
inline

◆ throw_on_failure() [2/2]

void mdbx::error::throw_on_failure ( int error_code)
inlinestatic

◆ throw_on_nullptr()

void mdbx::error::throw_on_nullptr ( const void * ptr,
MDBX_error_t error_code )
inlinestatic

◆ transaction_size_max()

size_t mdbx::env::limits::transaction_size_max ( intptr_t pagesize)
inlinestatic

Returns the maximal write transaction size (i.e. limit for summary volume of dirty pages) in bytes for specified page size.

◆ try_insert() [1/2]

value_result mdbx::cursor::try_insert ( const slice & key,
slice value )
inline

◆ try_insert() [2/2]

value_result mdbx::txn::try_insert ( map_handle map,
const slice & key,
slice value )
inline

◆ try_insert_reserve() [1/2]

value_result mdbx::cursor::try_insert_reserve ( const slice & key,
size_t value_length )
inline

◆ try_insert_reserve() [2/2]

value_result mdbx::txn::try_insert_reserve ( map_handle map,
const slice & key,
size_t value_length )
inline

◆ try_start_write()

txn_managed mdbx::env::try_start_write ( )
inline

Tries to start write (read-write) transaction without blocking.

◆ try_update() [1/2]

bool mdbx::cursor::try_update ( const slice & key,
const slice & value )
inline

◆ try_update() [2/2]

bool mdbx::txn::try_update ( map_handle map,
const slice & key,
const slice & value )
inline

◆ try_update_reserve() [1/2]

value_result mdbx::cursor::try_update_reserve ( const slice & key,
size_t value_length )
inline

◆ try_update_reserve() [2/2]

value_result mdbx::txn::try_update_reserve ( map_handle map,
const slice & key,
size_t value_length )
inline

◆ txn() [3/3]

txn mdbx::cursor::txn ( ) const
inline

Returns the cursor's transaction.

◆ unbind()

void mdbx::cursor::unbind ( )
inline

Unbind cursor from a transaction.

◆ unpark_reading()

bool mdbx::txn::unpark_reading ( bool restart_if_ousted = true)
inline

Resume parked read-only transaction.

Returns
True if transaction was restarted while restart_if_ousted=true.

◆ update() [1/2]

void mdbx::cursor::update ( const slice & key,
const slice & value )
inline

◆ update() [2/2]

void mdbx::txn::update ( map_handle map,
const slice & key,
const slice & value )
inline

◆ update_reserve() [1/2]

slice mdbx::cursor::update_reserve ( const slice & key,
size_t value_length )
inline

◆ update_reserve() [2/2]

slice mdbx::txn::update_reserve ( map_handle map,
const slice & key,
size_t value_length )
inline

◆ upper_bound()

cursor::move_result mdbx::cursor::upper_bound ( const slice & key,
bool throw_notfound = false )
inline

◆ upper_bound_multivalue()

cursor::move_result mdbx::cursor::upper_bound_multivalue ( const slice & key,
const slice & value,
bool throw_notfound = false )
inline

◆ upsert() [1/2]

void mdbx::cursor::upsert ( const slice & key,
const slice & value )
inline

◆ upsert() [2/2]

void mdbx::txn::upsert ( map_handle map,
const slice & key,
const slice & value )
inline

◆ upsert_reserve() [1/2]

slice mdbx::cursor::upsert_reserve ( const slice & key,
size_t value_length )
inline

◆ upsert_reserve() [2/2]

slice mdbx::txn::upsert_reserve ( map_handle map,
const slice & key,
size_t value_length )
inline

◆ valsize4page_max() [1/4]

size_t mdbx::env::limits::valsize4page_max ( const env & env,
MDBX_db_flags_t flags )
inlinestatic

Returns maximal data size in bytes to fit in a leaf-page or single large/overflow-page for given environment and table flags.

◆ valsize4page_max() [2/4]

size_t mdbx::env::limits::valsize4page_max ( const env & env,
value_mode mode )
inlinestatic

Returns maximal data size in bytes to fit in a leaf-page or single large/overflow-page for specified page size and values mode.

◆ valsize4page_max() [3/4]

size_t mdbx::env::limits::valsize4page_max ( intptr_t pagesize,
MDBX_db_flags_t flags )
inlinestatic

Returns maximal data size in bytes to fit in a leaf-page or single large/overflow-page for specified size and table flags.

◆ valsize4page_max() [4/4]

size_t mdbx::env::limits::valsize4page_max ( intptr_t pagesize,
value_mode mode )
inlinestatic

Returns maximal data size in bytes to fit in a leaf-page or single large/overflow-page for specified page size and values mode.

◆ value_max() [1/4]

size_t mdbx::env::limits::value_max ( const env & env,
MDBX_db_flags_t flags )
inlinestatic

Returns the maximal value size in bytes for given environment and table flags.

◆ value_max() [2/4]

size_t mdbx::env::limits::value_max ( const env & env,
value_mode mode )
inlinestatic

Returns the maximal value size in bytes for specified page size and values mode.

◆ value_max() [3/4]

size_t mdbx::env::limits::value_max ( intptr_t pagesize,
MDBX_db_flags_t flags )
inlinestatic

Returns the maximal value size in bytes for specified page size and table flags.

◆ value_max() [4/4]

size_t mdbx::env::limits::value_max ( intptr_t pagesize,
value_mode mode )
inlinestatic

Returns the maximal value size in bytes for specified page size and values mode.

◆ value_min() [1/2]

size_t mdbx::env::limits::value_min ( MDBX_db_flags_t flags)
inlinestaticnoexcept

Returns the minimal values size in bytes for specified table flags.

◆ value_min() [2/2]

size_t mdbx::env::limits::value_min ( value_mode mode)
inlinestaticnoexcept

Returns the minimal values size in bytes for specified values mode.

◆ value_mode()

MDBX_CXX11_CONSTEXPR_ENUM mdbx::value_mode mdbx::map_handle::info::value_mode ( ) const
noexcept

Variable Documentation

◆ buffer

template<class ALLOCATOR = default_allocator, class CAPACITY_POLICY = default_capacity_policy>
class MDBX_MSVC_DECLSPEC_EMPTY_BASES mdbx::buffer