Modules | |
exceptions and errors | |
slices and buffers | |
Namespaces | |
namespace | mdbx |
The libmdbx C++ API namespace. | |
namespace | std |
STL namespace. | |
Classes | |
class | mdbx::buffer< ALLOCATOR, CAPACITY_POLICY > |
The chunk of data stored inside the buffer or located outside it. More... | |
struct | mdbx::map_handle |
A handle for an individual table (aka key-value space, maps or sub-database) in the environment. More... | |
class | mdbx::env |
Unmanaged database environment. More... | |
class | mdbx::env_managed |
Managed database environment. More... | |
class | mdbx::txn |
Unmanaged database transaction. More... | |
class | mdbx::txn_managed |
Managed database transaction. More... | |
class | mdbx::cursor |
Unmanaged cursor. More... | |
class | mdbx::cursor_managed |
Managed cursor. More... | |
struct | std::hash<::mdbx::slice > |
Macros | |
#define | MDBX_STD_FILESYSTEM_PATH ::mdbx::filesystem::path |
Defined if mdbx::filesystem::path is available. | |
Typedefs | |
using | mdbx::byte = char8_t |
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::default_buffer = buffer< default_allocator, default_capacity_policy > |
Default buffer. | |
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::duration = ::std::chrono::duration< unsigned, ::std::ratio< 1, 65536 > > |
Duration in 1/65536 units of second. | |
using | mdbx::comparator = ::MDBX_cmp_func * |
Enumerations | |
enum | mdbx::loop_control { mdbx::continue_loop = 0 , mdbx::exit_loop = INT32_MIN } |
Loop control constants for readers enumeration functor and other cases. More... | |
enum class | mdbx::key_mode { mdbx::key_mode::usual = MDBX_DB_DEFAULTS , mdbx::key_mode::reverse = MDBX_REVERSEKEY , mdbx::key_mode::ordinal = MDBX_INTEGERKEY , mdbx::key_mode::msgpack = -1 } |
Kinds of the keys and corresponding modes of comparing it. More... | |
enum class | mdbx::value_mode { mdbx::value_mode::single = MDBX_DB_DEFAULTS , mdbx::value_mode::multi , mdbx::value_mode::multi_reverse , mdbx::value_mode::multi_samelength , mdbx::value_mode::multi_ordinal , mdbx::value_mode::multi_reverse_samelength , mdbx::value_mode::msgpack = -1 } |
Kind of the values and sorted multi-values with corresponding comparison. More... | |
enum | mdbx::put_mode { mdbx::insert_unique = MDBX_NOOVERWRITE , mdbx::upsert = MDBX_UPSERT , mdbx::update = MDBX_CURRENT } |
Key-value pairs put mode. More... | |
Functions | |
constexpr const version_info & | mdbx::get_version () noexcept |
Returns libmdbx version information. | |
constexpr const build_info & | mdbx::get_build () noexcept |
Returns libmdbx build information. | |
MDBX_CXX01_CONSTEXPR_ENUM bool | mdbx::is_usual (key_mode mode) noexcept |
MDBX_CXX01_CONSTEXPR_ENUM bool | mdbx::is_ordinal (key_mode mode) noexcept |
MDBX_CXX01_CONSTEXPR_ENUM bool | mdbx::is_samelength (key_mode mode) noexcept |
MDBX_CXX01_CONSTEXPR_ENUM bool | mdbx::is_reverse (key_mode mode) noexcept |
MDBX_CXX01_CONSTEXPR_ENUM bool | mdbx::is_msgpack (key_mode mode) noexcept |
MDBX_CXX01_CONSTEXPR_ENUM bool | mdbx::is_usual (value_mode mode) noexcept |
MDBX_CXX01_CONSTEXPR_ENUM bool | mdbx::is_multi (value_mode mode) noexcept |
MDBX_CXX01_CONSTEXPR_ENUM bool | mdbx::is_ordinal (value_mode mode) noexcept |
MDBX_CXX01_CONSTEXPR_ENUM bool | mdbx::is_samelength (value_mode mode) noexcept |
MDBX_CXX01_CONSTEXPR_ENUM bool | mdbx::is_reverse (value_mode mode) noexcept |
MDBX_CXX01_CONSTEXPR_ENUM bool | mdbx::is_msgpack (value_mode mode) noexcept |
comparator | mdbx::default_comparator (key_mode mode) noexcept |
comparator | mdbx::default_comparator (value_mode mode) noexcept |
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 &) |
template<class ALLOCATOR , typename CAPACITY_POLICY > | |
inline ::std::ostream & | mdbx::operator<< (::std::ostream &out, const buffer< ALLOCATOR, CAPACITY_POLICY > &it) |
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 bool | mdbx::operator== (const error &a, const error &b) noexcept |
constexpr bool | mdbx::operator!= (const error &a, const error &b) noexcept |
constexpr bool | mdbx::operator== (const slice &a, const slice &b) noexcept |
constexpr bool | mdbx::operator< (const slice &a, const slice &b) noexcept |
constexpr bool | mdbx::operator> (const slice &a, const slice &b) noexcept |
constexpr bool | mdbx::operator<= (const slice &a, const slice &b) noexcept |
constexpr bool | mdbx::operator>= (const slice &a, const slice &b) noexcept |
constexpr bool | mdbx::operator!= (const slice &a, const slice &b) noexcept |
constexpr bool | mdbx::operator== (const pair &a, const pair &b) noexcept |
constexpr bool | mdbx::operator< (const pair &a, const pair &b) noexcept |
constexpr bool | mdbx::operator> (const pair &a, const pair &b) noexcept |
constexpr bool | mdbx::operator<= (const pair &a, const pair &b) noexcept |
constexpr bool | mdbx::operator>= (const pair &a, const pair &b) noexcept |
constexpr bool | mdbx::operator!= (const pair &a, const pair &b) noexcept |
constexpr bool | mdbx::operator== (const env &a, const env &b) noexcept |
constexpr bool | mdbx::operator!= (const env &a, const env &b) noexcept |
constexpr bool | mdbx::operator== (const txn &a, const txn &b) noexcept |
constexpr bool | mdbx::operator!= (const txn &a, const txn &b) noexcept |
constexpr bool | mdbx::operator== (const cursor &a, const cursor &b) noexcept |
constexpr bool | mdbx::operator!= (const cursor &a, const cursor &b) noexcept |
int | mdbx::compare_position_nothrow (const cursor &left, const cursor &right, bool ignore_nested=false) noexcept |
int | mdbx::compare_position (const cursor &left, const cursor &right, bool ignore_nested=false) |
ptrdiff_t | mdbx::estimate (const cursor &from, const cursor &to) |
string | std::to_string (const ::mdbx::slice &value) |
template<class ALLOCATOR , typename CAPACITY_POLICY > | |
string | std::to_string (const ::mdbx::buffer< ALLOCATOR, CAPACITY_POLICY > &buffer) |
string | std::to_string (const ::mdbx::pair &value) |
string | std::to_string (const ::mdbx::env::geometry &value) |
string | std::to_string (const ::mdbx::env::operate_parameters &value) |
string | std::to_string (const ::mdbx::env::mode &value) |
string | std::to_string (const ::mdbx::env::durability &value) |
string | std::to_string (const ::mdbx::env::reclaiming_options &value) |
string | std::to_string (const ::mdbx::env::operate_options &value) |
string | std::to_string (const ::mdbx::env_managed::create_parameters &value) |
string | std::to_string (const ::MDBX_log_level_t &value) |
string | std::to_string (const ::MDBX_debug_flags_t &value) |
string | std::to_string (const ::mdbx::error &value) |
string | std::to_string (const ::MDBX_error_t &errcode) |
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 |
void | mdbx::error::panic_on_failure (const char *context_where, const char *func_who) const noexcept |
void | mdbx::error::success_or_panic (const char *context_where, const char *func_who) const noexcept |
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 void | mdbx::error::panic_on_failure (int error_code, const char *context_where, const char *func_who) noexcept |
static void | mdbx::error::success_or_panic (int error_code, const char *context_where, const char *func_who) noexcept |
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 |
slice & | mdbx::slice::assign (const void *ptr, size_t bytes) |
slice & | mdbx::slice::assign (const slice &src) noexcept |
slice & | mdbx::slice::assign (const ::MDBX_val &src) |
slice & | mdbx::slice::assign (slice &&src) noexcept |
slice & | mdbx::slice::assign (::MDBX_val &&src) |
slice & | mdbx::slice::assign (const void *begin, const void *end) |
slice & | mdbx::slice::assign (const char *c_str) |
slice & | mdbx::slice::operator= (slice &&src) noexcept |
slice & | mdbx::slice::operator= (::MDBX_val &&src) |
void | mdbx::slice::swap (slice &other) noexcept |
constexpr const byte * | mdbx::slice::byte_ptr () const noexcept |
Returns casted to pointer to byte an address of data. | |
constexpr const byte * | mdbx::slice::end_byte_ptr () const noexcept |
Returns casted to pointer to byte an end of data. | |
constexpr byte * | mdbx::slice::byte_ptr () noexcept |
constexpr byte * | mdbx::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 slice & | mdbx::slice::set_length (size_t bytes) |
Set slice length. | |
constexpr slice & | mdbx::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. | |
template<class ALLOCATOR = default_allocator> | |
string< ALLOCATOR > | mdbx::slice::as_hex_string (bool uppercase=false, unsigned wrap_width=0, const ALLOCATOR &allocator=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 &allocator=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 &allocator=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 &allocator=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 &allocator=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 &allocator=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 &allocator=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 &allocator=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 &allocator=ALLOCATOR()) const |
Decodes Base64 dump from the slice content to returned buffer. | |
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. | |
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. | |
template<class ALLOCATOR , typename CAPACITY_POLICY > | |
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer (const txn &txn, const struct slice &src, const allocator_type &allocator) | |
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 |
constexpr | mdbx::env::env (MDBX_env *ptr) noexcept |
env & | mdbx::env::operator= (env &&other) noexcept |
mdbx::env::env (env &&other) noexcept | |
mdbx::env::~env () noexcept | |
constexpr | mdbx::env::operator const MDBX_env * () const |
constexpr | mdbx::env::operator MDBX_env * () |
geometry & | mdbx::env::geometry::make_fixed (intptr_t size) noexcept |
geometry & | mdbx::env::geometry::make_dynamic (intptr_t lower=minimal_value, intptr_t upper=maximal_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. | |
env & | mdbx::env::set_context (void *your_context) |
Sets the application context associated with the environment. | |
env & | mdbx::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. | |
env & | mdbx::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 |
Controls interprocess/shared relative period since the last unsteady commit to force flush the data buffers to disk, if MDBX_SAFE_NOSYNC is used. | |
env & | mdbx::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 |
Controls interprocess/shared relative period since the last unsteady commit to force flush the data buffers to disk, if MDBX_SAFE_NOSYNC is used. | |
env & | mdbx::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. | |
env & | mdbx::env::alter_flags (MDBX_env_flags_t flags, bool on_off) |
Alter environment flags. | |
env & | mdbx::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. | |
env & | mdbx::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 |
txn & | mdbx::txn::operator= (txn &&other) noexcept |
mdbx::txn::txn (txn &&other) noexcept | |
mdbx::txn::~txn () noexcept | |
constexpr | mdbx::txn::operator const MDBX_txn * () const |
constexpr | mdbx::txn::operator MDBX_txn * () |
void * | mdbx::txn::get_context () const noexcept |
Returns the application context associated with the transaction. | |
txn & | mdbx::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::renew_reading () |
Renew read-only transaction. | |
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 ::mdbx::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 ::mdbx::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 ::mdbx::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 ::mdbx::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_handle_info (map_handle map) const |
Returns information about key-value map (aka table) handle. | |
txn & | mdbx::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 |
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 ALLOCATOR , typename CAPACITY_POLICY > | |
buffer< ALLOCATOR, CAPACITY_POLICY > | mdbx::txn::extract (map_handle map, const slice &key, const typename buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type &allocator=buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type()) |
Removes and return a value of the key. | |
template<class ALLOCATOR , typename CAPACITY_POLICY > | |
buffer< ALLOCATOR, CAPACITY_POLICY > | mdbx::txn::replace (map_handle map, const slice &key, const slice &new_value, const typename buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type &allocator=buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type()) |
Replaces and returns a value of the key with new one. | |
template<class ALLOCATOR , typename CAPACITY_POLICY > | |
buffer< ALLOCATOR, CAPACITY_POLICY > | mdbx::txn::replace_reserve (map_handle map, const slice &key, slice &new_value, const typename buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type &allocator=buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type()) |
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 |
cursor_managed | mdbx::cursor::clone (void *your_context=nullptr) const |
void * | mdbx::cursor::get_context () const noexcept |
Returns the application context associated with the cursor. | |
cursor & | mdbx::cursor::set_context (void *your_context) |
Sets the application context associated with the cursor. | |
cursor & | mdbx::cursor::operator= (cursor &&other) noexcept |
mdbx::cursor::cursor (cursor &&other) noexcept | |
mdbx::cursor::~cursor () noexcept | |
constexpr | mdbx::cursor::operator const MDBX_cursor * () const |
constexpr | mdbx::cursor::operator MDBX_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 |
void | mdbx::cursor::renew (const ::mdbx::txn &txn) |
Renew/bind a cursor with a new transaction and previously used key-value map handle. | |
void | mdbx::cursor::bind (const ::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. | |
class mdbx::buffer |
The chunk of data stored inside the buffer or located outside it.
using mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_traits = ::std::allocator_traits<allocator_type> |
using mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type = typename ::std::allocator_traits< ALLOCATOR>::template rebind_alloc<uint64_t> |
using mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::copy_assign_alloc = allocation_aware_details::copy_assign_alloc<silo, allocator_type> |
using mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::move_assign_alloc = allocation_aware_details::move_assign_alloc<silo, allocator_type> |
using mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::reservation_policy = CAPACITY_POLICY |
|
constexprdefaultnoexcept |
|
inlineconstexprnoexcept |
|
inline |
|
inline |
|
inline |
|
delete |
|
delete |
|
inline |
|
inline |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |
|
inlineconstexpr |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineconstexpr |
|
inline |
|
inlineconstexpr |
|
inline |
|
inlineconstexpr |
|
inline |
|
inlineconstexpr |
|
inline |
|
inlineconstexpr |
|
inline |
|
inlineconstexpr |
|
inlineconstexpr |
|
inline |
|
inline |
|
inlineconstexpr |
|
inline |
|
inlineconstexpr |
|
inline |
|
inlineconstexpr |
|
inline |
|
inlineconstexpr |
|
inline |
|
inlineconstexpr |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineconstexpr |
Accesses the specified byte of data chunk with bounds checking.
std::out_of_range | if n >= size() |
|
inlineconstexpr |
Accesses the specified byte of data chunk with bounds checking.
std::out_of_range | if n >= size() |
|
inlinestatic |
Returns a new buffer with a Base58 dump of the slice content.
|
inlinestatic |
Returns a new buffer with a Base58 dump of the given pod.
|
inline |
Decodes Base58 dump from the buffer content to new returned buffer.
|
inlinestatic |
Decodes Base58 dump from the slice content to returned buffer.
|
inlinestatic |
Returns a new buffer with a Base64 dump of the slice content.
|
inlinestatic |
Returns a new buffer with a Base64 dump of the given pod.
|
inline |
Decodes Base64 dump from the buffer content to new returned buffer.
|
inlinestatic |
Decodes Base64 dump from the slice content to returned buffer.
|
inlineconstexprnoexcept |
Returns casted to const pointer to byte an address of data.
|
inlineconstexprnoexcept |
Returns casted to pointer to byte an address of data.
|
inline |
|
inline |
|
inlineconstexprnoexcept |
Returns the number of bytes that can be held in currently allocated storage.
|
inlineconstexprnoexcept |
Returns casted to const pointer to char an address of data.
|
inlineconstexprnoexcept |
Returns casted to pointer to char an address of data.
|
inline |
|
inline |
|
inlinenoexcept |
Clears the contents and storage.
|
inlinenoexcept |
Clears the contents and reserve storage.
|
inlinestatic |
|
inlineconstexprnoexcept |
Return a const pointer to the beginning of the referenced data.
|
inlineconstexprnoexcept |
Return a pointer to the beginning of the referenced data.
|
inlineconstexprnoexcept |
Checks whether the string is empty.
|
inline |
Returns a new buffer with a Base58 dump of the slice content.
|
inline |
Returns a new buffer with a Base64 dump of the slice content.
|
inline |
Returns a new buffer with a hexadecimal dump of the slice content.
|
inlineconstexprnoexcept |
Return a const pointer to the end of the referenced data.
|
inlineconstexprnoexcept |
Return a pointer to the end of the referenced data.
|
inlineconstexprnoexcept |
Returns casted to const pointer to byte an end of data.
|
inlineconstexprnoexcept |
Returns casted to pointer to byte an end of data.
|
inlineconstexprnoexcept |
Returns casted to const pointer to char an end of data.
|
inlineconstexprnoexcept |
Returns casted to pointer to char an end of data.
|
inlinenoexcept |
Checks if the data ends with the given suffix.
|
inlineconstexpr |
Returns the associated allocator.
|
inlineconstexprnoexcept |
Returns the hash value of the data.
|
inlinenoexcept |
Returns the first "n" bytes of the data chunk.
n <= size()
|
inlineconstexprnoexcept |
Returns the number of bytes that available in currently allocated storage ahead the currently beginning of data.
|
inlinestatic |
Returns a new buffer with a hexadecimal dump of the slice content.
|
inlinestatic |
Returns a new buffer with a hexadecimal dump of the given pod.
|
inline |
Decodes hexadecimal dump from the buffer content to new returned buffer.
|
inlinestatic |
Decodes hexadecimal dump from the slice content to returned buffer.
|
inlineconstexprnoexcept |
Checks whether data chunk stored inside the buffer, otherwise buffer just refers to data located outside the buffer.
|
inlineconstexprnoexcept |
Checks whether the data pointer of the buffer is nullptr.
|
inlineconstexprnoexcept |
Checks whether the buffer just refers to data located outside the buffer, rather than stores it.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestaticnoexcept |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlineconstexprnoexcept |
Returns the number of bytes.
|
inline |
Makes buffer owning the data.
If buffer refers to an external data, then makes it the owner of clone by allocating storage and copying the data.
|
inlinenoexcept |
Returns the middle "n" bytes of the data chunk.
from + n <= size()
|
inlineconstexprnoexcept |
|
inlineexplicitconstexpr |
|
inlinenoexcept |
Return a string_view that references the data of this buffer.
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
|
inlineconstexprnoexcept |
Accesses the specified byte of data chunk.
n < size()
|
inlineconstexprnoexcept |
Accesses the specified byte of data chunk.
n < size()
|
inlinenoexcept |
Drops the first "n" bytes from the data chunk.
n <= size()
|
inlinenoexcept |
Drops the last "n" bytes from the data chunk.
n <= size()
|
inline |
Reserves storage space.
|
inline |
Reserves space before the payload.
|
inline |
Reserves space after the payload.
|
inline |
Returns the first "n" bytes of the data chunk.
std::out_of_range | if n >= size() |
|
inline |
Returns the middle "n" bytes of the data chunk.
std::out_of_range | if from + n >= size() |
|
inline |
Drops the first "n" bytes from the data chunk.
std::out_of_range | if n > size() |
|
inline |
Drops the last "n" bytes from the data chunk.
std::out_of_range | if n > size() |
|
inline |
Returns the last "n" bytes of the data chunk.
std::out_of_range | if n >= size() |
|
inlineconstexpr |
Sets the length by specifying the end of the data.
|
inlineconstexpr |
Set length of data.
|
inline |
Reduces memory usage by freeing unused storage space.
|
inlineconstexprnoexcept |
Returns the number of bytes.
|
inlinenoexcept |
|
inlinenoexcept |
Checks if the data starts with the given prefix.
|
inlinenoexcept |
Return a string_view that references the data of this buffer.
|
inlineconstexprnoexcept |
|
inlinenoexcept |
Returns the last "n" bytes of the data chunk.
n <= size()
|
inlineconstexprnoexcept |
Returns the number of bytes that available in currently allocated storage after the currently data end.
|
inlinestatic |
struct mdbx::map_handle |
A handle for an individual table (aka key-value space, maps or sub-database) in the environment.
Public Types | |
using | flags = ::MDBX_db_flags_t |
using | state = ::MDBX_dbi_state_t |
Public Member Functions | |
constexpr | map_handle () noexcept |
constexpr | map_handle (MDBX_dbi dbi) noexcept |
map_handle (const map_handle &) noexcept=default | |
map_handle & | operator= (const map_handle &) noexcept=default |
operator MDBX_dbi () const | |
Public Attributes | |
MDBX_dbi | dbi {0} |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
defaultnoexcept |
|
inline |
|
defaultnoexcept |
MDBX_dbi mdbx::map_handle::dbi {0} |
class mdbx::env |
Unmanaged database environment.
Like other unmanaged classes, env
allows copying and assignment for instances, but does not destroys the represented underlying object from the own class destructor.
An environment supports multiple key-value tables (aka key-value maps, spaces or sub-databases), all residing in the same shared-memory mapped file.
Inherited by mdbx::env_managed.
Public Types | |
enum | mode { readonly , write_file_io , write_mapped_io , nested_transactions = write_file_io } |
Operation mode. More... | |
enum | durability { robust_synchronous , half_synchronous_weak_last , lazy_weak_tail , whole_fragile } |
Durability level. More... | |
enum | remove_mode { just_remove = MDBX_ENV_JUST_DELETE , ensure_unused = MDBX_ENV_ENSURE_UNUSED , wait_for_unused = MDBX_ENV_WAIT_FOR_UNUSED } |
Deletion modes for remove(). More... | |
enum class | extra_runtime_option { max_maps = MDBX_opt_max_db , max_readers = MDBX_opt_max_readers , sync_bytes = MDBX_opt_sync_bytes , sync_period = MDBX_opt_sync_period , rp_augment_limit = MDBX_opt_rp_augment_limit , loose_limit = MDBX_opt_loose_limit , dp_reserve_limit = MDBX_opt_dp_reserve_limit , dp_limit = MDBX_opt_txn_dp_limit , dp_initial = MDBX_opt_txn_dp_initial , spill_max_denominator = MDBX_opt_spill_max_denominator , spill_min_denominator = MDBX_opt_spill_min_denominator , spill_parent4child_denominator = MDBX_opt_spill_parent4child_denominator , merge_threshold_16dot16_percent = MDBX_opt_merge_threshold_16dot16_percent , writethrough_threshold = MDBX_opt_writethrough_threshold , prefault_write_enable = MDBX_opt_prefault_write_enable } |
MDBX environment extra runtime options. More... | |
using | stat = ::MDBX_stat |
Statistics for a database in the MDBX environment. | |
using | info = ::MDBX_envinfo |
Information about the environment. | |
Public Member Functions | |
constexpr | env () noexcept=default |
env (const env &) noexcept=default | |
env & | operator= (env &&other) noexcept |
env (env &&other) noexcept | |
~env () noexcept | |
constexpr | operator const MDBX_env * () const |
constexpr | operator MDBX_env * () |
env::operate_parameters | get_operation_parameters () const |
Returns current operation parameters. | |
env::mode | get_mode () const |
Returns current operation mode. | |
env::durability | get_durability () const |
Returns current durability mode. | |
env::reclaiming_options | get_reclaiming () const |
Returns current reclaiming options. | |
env::operate_options | get_options () const |
Returns current operate options. | |
bool | is_pristine () const |
Returns true for a freshly created database, but false if at least one transaction was committed. | |
bool | is_empty () const |
Checks whether the database is empty. | |
size_t | dbsize_min () const |
Returns the minimal database size in bytes for the environment. | |
size_t | dbsize_max () const |
Returns the maximal database size in bytes for the environment. | |
size_t | key_min (key_mode mode) const noexcept |
Returns the minimal key size in bytes for specified keys mode. | |
size_t | key_max (key_mode mode) const |
Returns the maximal key size in bytes for specified keys mode. | |
size_t | value_min (value_mode mode) const noexcept |
Returns the minimal value size in bytes for specified values mode. | |
size_t | value_max (value_mode mode) const |
Returns the maximal value size in bytes for specified values mode. | |
size_t | transaction_size_max () const |
Returns the maximal write transaction size (i.e. limit for summary volume of dirty pages) in bytes. | |
env & | copy (const ::mdbx::filesystem::path &destination, bool compactify, bool force_dynamic_size=false) |
Make a copy (backup) of an existing environment to the specified path. | |
env & | copy (const ::std::wstring &destination, bool compactify, bool force_dynamic_size=false) |
env & | copy (const wchar_t *destination, bool compactify, bool force_dynamic_size=false) |
env & | copy (const ::std::string &destination, bool compactify, bool force_dynamic_size=false) |
env & | copy (const char *destination, bool compactify, bool force_dynamic_size=false) |
env & | copy (filehandle fd, bool compactify, bool force_dynamic_size=false) |
Copy an environment to the specified file descriptor. | |
stat | get_stat () const |
Returns snapshot statistics about the MDBX environment. | |
size_t | get_pagesize () const |
Returns pagesize of this MDBX environment. | |
info | get_info () const |
Return snapshot information about the MDBX environment. | |
stat | get_stat (const txn &) const |
Return statistics about the MDBX environment accordingly to the specified transaction. | |
info | get_info (const txn &) const |
Return information about the MDBX environment accordingly to the specified transaction. | |
filehandle | get_filehandle () const |
Returns the file descriptor for the DXB file of MDBX environment. | |
path | get_path () const |
Return the path that was used for opening the environment. | |
MDBX_env_flags_t | get_flags () const |
Returns environment flags. | |
unsigned | max_readers () const |
Returns the maximum number of threads/reader slots for the environment. | |
unsigned | max_maps () const |
Returns the maximum number of named tables for the environment. | |
void * | get_context () const noexcept |
Returns the application context associated with the environment. | |
env & | set_context (void *your_context) |
Sets the application context associated with the environment. | |
env & | set_sync_threshold (size_t bytes) |
Sets threshold to force flush the data buffers to disk, for non-sync durability modes. | |
size_t | sync_threshold () const |
Gets threshold used to force flush the data buffers to disk, for non-sync durability modes. | |
env & | set_sync_period (const duration &period) |
Sets relative period since the last unsteady commit to force flush the data buffers to disk, for non-sync durability modes. | |
duration | sync_period () const |
Gets relative period since the last unsteady commit that used to force flush the data buffers to disk, for non-sync durability modes. | |
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 | sync_period__seconds_16dot16 () const |
Controls interprocess/shared relative period since the last unsteady commit to force flush the data buffers to disk, if MDBX_SAFE_NOSYNC is used. | |
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 | sync_period__seconds_double () const |
Controls interprocess/shared relative period since the last unsteady commit to force flush the data buffers to disk, if MDBX_SAFE_NOSYNC is used. | |
env & | set_extra_option (extra_runtime_option option, uint64_t value) |
Sets the value of a extra runtime options for an environment. | |
uint64_t | extra_option (extra_runtime_option option) const |
Gets the value of extra runtime options from an environment. | |
env & | alter_flags (MDBX_env_flags_t flags, bool on_off) |
Alter environment flags. | |
env & | set_geometry (const geometry &size) |
Set all size-related parameters of environment. | |
bool | sync_to_disk (bool force=true, bool nonblock=false) |
Flush the environment data buffers. | |
bool | poll_sync_to_disk () |
Performs non-blocking polling of sync-to-disk thresholds. | |
void | close_map (const map_handle &) |
Close a key-value map (aka table) handle. Normally unnecessary. | |
template<typename VISITOR > | |
int | enumerate_readers (VISITOR &visitor) |
Enumerate readers. | |
unsigned | check_readers () |
Checks for stale readers in the lock table and return number of cleared slots. | |
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 * | 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 | start_read () const |
Starts read (read-only) transaction. | |
txn_managed | prepare_read () const |
Creates but not start read transaction. | |
txn_managed | start_write (txn &parent) |
Starts write (read-write) transaction. | |
txn_managed | start_write (bool dont_wait=false) |
Starts write (read-write) transaction. | |
txn_managed | try_start_write () |
Tries to start write (read-write) transaction without blocking. | |
Static Public Member Functions | |
static size_t | default_pagesize () noexcept |
Returns default page size for current system/platform. | |
static bool | remove (const ::mdbx::filesystem::path &pathname, const remove_mode mode=just_remove) |
Removes the environment's files in a proper and multiprocess-safe way. | |
static bool | remove (const ::std::wstring &pathname, const remove_mode mode=just_remove) |
static bool | remove (const wchar_t *pathname, const remove_mode mode=just_remove) |
static bool | remove (const ::std::string &pathname, const remove_mode mode=just_remove) |
static bool | remove (const char *pathname, const remove_mode mode=just_remove) |
Protected Member Functions | |
constexpr | env (MDBX_env *ptr) noexcept |
Protected Attributes | |
MDBX_env * | handle_ {nullptr} |
Friends | |
class | txn |
constexpr bool | operator== (const env &a, const env &b) noexcept |
constexpr bool | operator!= (const env &a, const env &b) noexcept |
using mdbx::env::info = ::MDBX_envinfo |
Information about the environment.
using mdbx::env::stat = ::MDBX_stat |
Statistics for a database in the MDBX environment.
Durability level.
Enumerator | |
---|---|
robust_synchronous | Default robust and durable sync mode. Metadata is written and flushed to disk after a data is written and flushed, which guarantees the integrity of the database in the event of a crash at any time.
|
half_synchronous_weak_last | Don't sync the meta-page after commit. Flush system buffers to disk only once per transaction commit, omit the metadata flush. Defer that until the system flushes files to disk, or next non-MDBX_RDONLY commit or mdbx_env_sync(). Depending on the platform and hardware, with MDBX_NOMETASYNC you may get a doubling of write performance. This trade-off maintains database integrity, but a system crash may undo the last committed transaction. I.e. it preserves the ACI (atomicity, consistency, isolation) but not D (durability) database property.
|
lazy_weak_tail | Don't sync anything but keep previous steady commits. Like MDBX_UTTERLY_NOSYNC the With MDBX_WRITEMAP the Depending on the platform and hardware, with In contrast to MDBX_UTTERLY_NOSYNC mode, with
In other words, with The number and volume of of disk IOPs with MDBX_SAFE_NOSYNC flag will exactly the as without any no-sync flags. However, you should expect a larger process's work set and significantly worse a locality of reference, due to the more intensive allocation of previously unused pages and increase the size of the database.
|
whole_fragile | Don't sync anything and wipe previous steady commits. Don't flush system buffers to disk when committing a transaction. This optimization means a system crash can corrupt the database, if buffers are not yet flushed to disk. Depending on the platform and hardware, with If the filesystem preserves write order (which is rare and never provided unless explicitly noted) and the MDBX_WRITEMAP and MDBX_LIFORECLAIM flags are not used, then a system crash can't corrupt the database, but you can lose the last transactions, if at least one buffer is not yet flushed to disk. The risk is governed by how often the system flushes dirty buffers to disk and how often mdbx_env_sync() is called. So, transactions exhibit ACI (atomicity, consistency, isolation) properties and only lose Otherwise, if the filesystem not preserves write order (which is typically) or MDBX_WRITEMAP or MDBX_LIFORECLAIM flags are used, you should expect the corrupted database after a system crash. So, most important thing about
Nevertheless,
|
|
strong |
MDBX environment extra runtime options.
Enumerator | |
---|---|
max_maps | Controls the maximum number of named tables for the environment. By default only unnamed key-value table could used and appropriate value should set by |
max_readers | Defines the maximum number of threads/reader slots for all processes interacting with the database. This defines the number of slots in the lock table that is used to track readers in the the environment. The default is about 100 for 4K system page size. Starting a read-only transaction normally ties a lock table slot to the current thread until the environment closes or the thread exits. If MDBX_NOSTICKYTHREADS is in use, mdbx_txn_begin() instead ties the slot to the MDBX_txn object until it or the MDBX_env object is destroyed. This option may only set after mdbx_env_create() and before mdbx_env_open(), and has an effect only when the database is opened by the first process interacts with the database. |
sync_bytes | Controls interprocess/shared threshold to force flush the data buffers to disk, if MDBX_SAFE_NOSYNC is used. |
sync_period | Controls interprocess/shared relative period since the last unsteady commit to force flush the data buffers to disk, if MDBX_SAFE_NOSYNC is used. |
rp_augment_limit | Controls the in-process limit to grow a list of reclaimed/recycled page's numbers for finding a sequence of contiguous pages for large data items.
A long values requires allocation of contiguous database pages. To find such sequences, it may be necessary to accumulate very large lists, especially when placing very long values (more than a megabyte) in a large databases (several tens of gigabytes), which is much expensive in extreme cases. This threshold allows you to avoid such costs by allocating new pages at the end of the database (with its possible growth on disk), instead of further accumulating/reclaiming Garbage Collection records. On the other hand, too small threshold will lead to unreasonable database growth, or/and to the inability of put long values. The |
loose_limit | Controls the in-process limit to grow a cache of dirty pages for reuse in the current transaction. A 'dirty page' refers to a page that has been updated in memory only, the changes to a dirty page are not yet stored on disk. To reduce overhead, it is reasonable to release not all such pages immediately, but to leave some ones in cache for reuse in the current transaction. The |
dp_reserve_limit | Controls the in-process limit of a pre-allocated memory items for dirty pages. A 'dirty page' refers to a page that has been updated in memory only, the changes to a dirty page are not yet stored on disk. Without MDBX_WRITEMAP dirty pages are allocated from memory and released when a transaction is committed. To reduce overhead, it is reasonable to release not all ones, but to leave some allocations in reserve for reuse in the next transaction(s). The |
dp_limit | Controls the in-process limit of dirty pages for a write transaction. A 'dirty page' refers to a page that has been updated in memory only, the changes to a dirty page are not yet stored on disk. Without MDBX_WRITEMAP dirty pages are allocated from memory and will be busy until are written to disk. Therefore for a large transactions is reasonable to limit dirty pages collecting above an some threshold but spill to disk instead. The |
dp_initial | Controls the in-process initial allocation size for dirty pages list of a write transaction. Default is 1024. |
spill_max_denominator | Controls the in-process how maximal part of the dirty pages may be spilled when necessary. The Should be in the range 0..255, where zero means no limit, i.e. all dirty pages could be spilled. Default is 8, i.e. no more than 7/8 of the current dirty pages may be spilled when reached the condition described above. |
spill_min_denominator | Controls the in-process how minimal part of the dirty pages should be spilled when necessary. The Should be in the range 0..255, where zero means no restriction at the bottom. Default is 8, i.e. at least the 1/8 of the current dirty pages should be spilled when reached the condition described above. |
spill_parent4child_denominator | Controls the in-process how much of the parent transaction dirty pages will be spilled while start each child transaction. The For a stack of nested transactions each dirty page could be spilled only once, and parent's dirty pages couldn't be spilled while child transaction(s) are running. Therefore a child transaction could reach MDBX_TXN_FULL when parent(s) transaction has spilled too less (and child reach the limit of dirty pages), either when parent(s) has spilled too more (since child can't spill already spilled pages). So there is no universal golden ratio. Should be in the range 0..255, where zero means no explicit spilling will be performed during starting nested transactions. Default is 0, i.e. by default no spilling performed during starting nested transactions, that correspond historically behaviour. |
merge_threshold_16dot16_percent | Controls the in-process threshold of semi-empty pages merge. This option controls the in-process threshold of minimum page fill, as used space of percentage of a page. Neighbour pages emptier than this value are candidates for merging. The threshold value is specified in 1/65536 points of a whole page, which is equivalent to the 16-dot-16 fixed point format. The specified value must be in the range from 12.5% (almost empty page) to 50% (half empty page) which corresponds to the range from 8192 and to 32768 in units respectively. |
writethrough_threshold | Controls the choosing between use write-through disk writes and usual ones with followed flush by the Depending on the operating system, storage subsystem characteristics and the use case, higher performance can be achieved by either using write-through or a serie of usual/lazy writes followed by the flush-to-disk. Basically for N chunks the latency/cost of write-through is: latency = N * (emit + round-trip-to-storage + storage-execution); And for serie of lazy writes with flush is: latency = N * (emit + storage-execution) + flush + round-trip-to-storage. So, for large N and/or noteable round-trip-to-storage the write+flush approach is win. But for small N and/or near-zero NVMe-like latency the write-through is better. To solve this issue libmdbx provide
|
prefault_write_enable | Controls prevention of page-faults of reclaimed and allocated pages in the MDBX_WRITEMAP mode by clearing ones through file handle before touching. |
enum mdbx::env::mode |
Operation mode.
Enumerator | |
---|---|
readonly | Read only mode. Open the environment in read-only mode. No write operations will be allowed. MDBX will still modify the lock file - except on read-only filesystems, where MDBX does not use locks.
This flag affects only at environment opening but can't be changed after. |
write_file_io | |
write_mapped_io | Map data into memory with write permission. Use a writeable memory map unless MDBX_RDONLY is set. This uses fewer mallocs and requires much less work for tracking database pages, but loses protection from application bugs like wild pointer writes and other bad updates into the database. This may be slightly faster for DBs that fit entirely in RAM, but is slower for DBs larger than RAM. Also adds the possibility for stray application writes thru pointers to silently corrupt the database.
This flag affects only at environment opening but can't be changed after. |
nested_transactions |
Deletion modes for remove().
|
constexprdefaultnoexcept |
|
defaultnoexcept |
env & mdbx::env::copy | ( | const ::mdbx::filesystem::path & | destination, |
bool | compactify, | ||
bool | force_dynamic_size = false |
||
) |
Make a copy (backup) of an existing environment to the specified path.
env & mdbx::env::copy | ( | const ::std::string & | destination, |
bool | compactify, | ||
bool | force_dynamic_size = false |
||
) |
env & mdbx::env::copy | ( | const ::std::wstring & | destination, |
bool | compactify, | ||
bool | force_dynamic_size = false |
||
) |
env & mdbx::env::copy | ( | const char * | destination, |
bool | compactify, | ||
bool | force_dynamic_size = false |
||
) |
env & mdbx::env::copy | ( | const wchar_t * | destination, |
bool | compactify, | ||
bool | force_dynamic_size = false |
||
) |
env & mdbx::env::copy | ( | filehandle | fd, |
bool | compactify, | ||
bool | force_dynamic_size = false |
||
) |
Copy an environment to the specified file descriptor.
|
inline |
Returns the maximal database size in bytes for the environment.
|
inline |
Returns the minimal database size in bytes for the environment.
|
inlinestaticnoexcept |
Returns default page size for current system/platform.
|
inline |
Returns pagesize of this MDBX environment.
path mdbx::env::get_path | ( | ) | const |
Return the path that was used for opening the environment.
bool mdbx::env::is_empty | ( | ) | const |
Checks whether the database is empty.
bool mdbx::env::is_pristine | ( | ) | const |
Returns true
for a freshly created database, but false
if at least one transaction was committed.
|
inline |
Returns the maximal key size in bytes for specified keys mode.
|
inlinenoexcept |
Returns the minimal key size in bytes for specified keys mode.
|
inline |
Performs non-blocking polling of sync-to-disk thresholds.
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.
|
static |
Removes the environment's files in a proper and multiprocess-safe way.
|
static |
|
static |
|
static |
|
static |
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.
|
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.
|
inline |
Returns the maximal write transaction size (i.e. limit for summary volume of dirty pages) in bytes.
|
inline |
Returns the maximal value size in bytes for specified values mode.
|
inlinenoexcept |
Returns the minimal value size in bytes for specified values mode.
|
friend |
|
protected |
class mdbx::env_managed |
Managed database environment.
As other managed classes, env_managed
destroys the represented underlying object from the own class destructor, but disallows copying and assignment for instances.
An environment supports multiple key-value tables (aka key-value spaces or maps), all residing in the same shared-memory mapped file.
Inherits mdbx::env.
Public Member Functions | |
constexpr | env_managed () noexcept=default |
env_managed (const ::mdbx::filesystem::path &pathname, const operate_parameters &, bool accede=true) | |
Open existing database. | |
env_managed (const ::std::wstring &pathname, const operate_parameters &, bool accede=true) | |
env_managed (const wchar_t *pathname, const operate_parameters &, bool accede=true) | |
env_managed (const ::std::string &pathname, const operate_parameters &, bool accede=true) | |
env_managed (const char *pathname, const operate_parameters &, bool accede=true) | |
env_managed (const ::mdbx::filesystem::path &pathname, const create_parameters &, const operate_parameters &, bool accede=true) | |
Create new or open existing database. | |
env_managed (const ::std::wstring &pathname, const create_parameters &, const operate_parameters &, bool accede=true) | |
env_managed (const wchar_t *pathname, const create_parameters &, const operate_parameters &, bool accede=true) | |
env_managed (const ::std::string &pathname, const create_parameters &, const operate_parameters &, bool accede=true) | |
env_managed (const char *pathname, const create_parameters &, const operate_parameters &, bool accede=true) | |
void | close (bool dont_sync=false) |
Explicitly closes the environment and release the memory map. | |
env_managed (env_managed &&)=default | |
env_managed & | operator= (env_managed &&other) noexcept |
env_managed (const env_managed &)=delete | |
env_managed & | operator= (const env_managed &)=delete |
virtual | ~env_managed () noexcept |
Public Member Functions inherited from mdbx::env | |
constexpr | env () noexcept=default |
env (const env &) noexcept=default | |
env & | operator= (env &&other) noexcept |
env (env &&other) noexcept | |
~env () noexcept | |
constexpr | operator const MDBX_env * () const |
constexpr | operator MDBX_env * () |
env::operate_parameters | get_operation_parameters () const |
Returns current operation parameters. | |
env::mode | get_mode () const |
Returns current operation mode. | |
env::durability | get_durability () const |
Returns current durability mode. | |
env::reclaiming_options | get_reclaiming () const |
Returns current reclaiming options. | |
env::operate_options | get_options () const |
Returns current operate options. | |
bool | is_pristine () const |
Returns true for a freshly created database, but false if at least one transaction was committed. | |
bool | is_empty () const |
Checks whether the database is empty. | |
size_t | dbsize_min () const |
Returns the minimal database size in bytes for the environment. | |
size_t | dbsize_max () const |
Returns the maximal database size in bytes for the environment. | |
size_t | key_min (key_mode mode) const noexcept |
Returns the minimal key size in bytes for specified keys mode. | |
size_t | key_max (key_mode mode) const |
Returns the maximal key size in bytes for specified keys mode. | |
size_t | value_min (value_mode mode) const noexcept |
Returns the minimal value size in bytes for specified values mode. | |
size_t | value_max (value_mode mode) const |
Returns the maximal value size in bytes for specified values mode. | |
size_t | transaction_size_max () const |
Returns the maximal write transaction size (i.e. limit for summary volume of dirty pages) in bytes. | |
env & | copy (const ::mdbx::filesystem::path &destination, bool compactify, bool force_dynamic_size=false) |
Make a copy (backup) of an existing environment to the specified path. | |
env & | copy (const ::std::wstring &destination, bool compactify, bool force_dynamic_size=false) |
env & | copy (const wchar_t *destination, bool compactify, bool force_dynamic_size=false) |
env & | copy (const ::std::string &destination, bool compactify, bool force_dynamic_size=false) |
env & | copy (const char *destination, bool compactify, bool force_dynamic_size=false) |
env & | copy (filehandle fd, bool compactify, bool force_dynamic_size=false) |
Copy an environment to the specified file descriptor. | |
stat | get_stat () const |
Returns snapshot statistics about the MDBX environment. | |
size_t | get_pagesize () const |
Returns pagesize of this MDBX environment. | |
info | get_info () const |
Return snapshot information about the MDBX environment. | |
stat | get_stat (const txn &) const |
Return statistics about the MDBX environment accordingly to the specified transaction. | |
info | get_info (const txn &) const |
Return information about the MDBX environment accordingly to the specified transaction. | |
filehandle | get_filehandle () const |
Returns the file descriptor for the DXB file of MDBX environment. | |
path | get_path () const |
Return the path that was used for opening the environment. | |
MDBX_env_flags_t | get_flags () const |
Returns environment flags. | |
unsigned | max_readers () const |
Returns the maximum number of threads/reader slots for the environment. | |
unsigned | max_maps () const |
Returns the maximum number of named tables for the environment. | |
void * | get_context () const noexcept |
Returns the application context associated with the environment. | |
env & | set_context (void *your_context) |
Sets the application context associated with the environment. | |
env & | set_sync_threshold (size_t bytes) |
Sets threshold to force flush the data buffers to disk, for non-sync durability modes. | |
size_t | sync_threshold () const |
Gets threshold used to force flush the data buffers to disk, for non-sync durability modes. | |
env & | set_sync_period (const duration &period) |
Sets relative period since the last unsteady commit to force flush the data buffers to disk, for non-sync durability modes. | |
duration | sync_period () const |
Gets relative period since the last unsteady commit that used to force flush the data buffers to disk, for non-sync durability modes. | |
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 | sync_period__seconds_16dot16 () const |
Controls interprocess/shared relative period since the last unsteady commit to force flush the data buffers to disk, if MDBX_SAFE_NOSYNC is used. | |
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 | sync_period__seconds_double () const |
Controls interprocess/shared relative period since the last unsteady commit to force flush the data buffers to disk, if MDBX_SAFE_NOSYNC is used. | |
env & | set_extra_option (extra_runtime_option option, uint64_t value) |
Sets the value of a extra runtime options for an environment. | |
uint64_t | extra_option (extra_runtime_option option) const |
Gets the value of extra runtime options from an environment. | |
env & | alter_flags (MDBX_env_flags_t flags, bool on_off) |
Alter environment flags. | |
env & | set_geometry (const geometry &size) |
Set all size-related parameters of environment. | |
bool | sync_to_disk (bool force=true, bool nonblock=false) |
Flush the environment data buffers. | |
bool | poll_sync_to_disk () |
Performs non-blocking polling of sync-to-disk thresholds. | |
void | close_map (const map_handle &) |
Close a key-value map (aka table) handle. Normally unnecessary. | |
template<typename VISITOR > | |
int | enumerate_readers (VISITOR &visitor) |
Enumerate readers. | |
unsigned | check_readers () |
Checks for stale readers in the lock table and return number of cleared slots. | |
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 * | 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 | start_read () const |
Starts read (read-only) transaction. | |
txn_managed | prepare_read () const |
Creates but not start read transaction. | |
txn_managed | start_write (txn &parent) |
Starts write (read-write) transaction. | |
txn_managed | start_write (bool dont_wait=false) |
Starts write (read-write) transaction. | |
txn_managed | try_start_write () |
Tries to start write (read-write) transaction without blocking. | |
Additional Inherited Members | |
Public Types inherited from mdbx::env | |
enum | mode { readonly , write_file_io , write_mapped_io , nested_transactions = write_file_io } |
Operation mode. More... | |
enum | durability { robust_synchronous , half_synchronous_weak_last , lazy_weak_tail , whole_fragile } |
Durability level. More... | |
enum | remove_mode { just_remove = MDBX_ENV_JUST_DELETE , ensure_unused = MDBX_ENV_ENSURE_UNUSED , wait_for_unused = MDBX_ENV_WAIT_FOR_UNUSED } |
Deletion modes for remove(). More... | |
enum class | extra_runtime_option { max_maps = MDBX_opt_max_db , max_readers = MDBX_opt_max_readers , sync_bytes = MDBX_opt_sync_bytes , sync_period = MDBX_opt_sync_period , rp_augment_limit = MDBX_opt_rp_augment_limit , loose_limit = MDBX_opt_loose_limit , dp_reserve_limit = MDBX_opt_dp_reserve_limit , dp_limit = MDBX_opt_txn_dp_limit , dp_initial = MDBX_opt_txn_dp_initial , spill_max_denominator = MDBX_opt_spill_max_denominator , spill_min_denominator = MDBX_opt_spill_min_denominator , spill_parent4child_denominator = MDBX_opt_spill_parent4child_denominator , merge_threshold_16dot16_percent = MDBX_opt_merge_threshold_16dot16_percent , writethrough_threshold = MDBX_opt_writethrough_threshold , prefault_write_enable = MDBX_opt_prefault_write_enable } |
MDBX environment extra runtime options. More... | |
using | stat = ::MDBX_stat |
Statistics for a database in the MDBX environment. | |
using | info = ::MDBX_envinfo |
Information about the environment. | |
Static Public Member Functions inherited from mdbx::env | |
static size_t | default_pagesize () noexcept |
Returns default page size for current system/platform. | |
static bool | remove (const ::mdbx::filesystem::path &pathname, const remove_mode mode=just_remove) |
Removes the environment's files in a proper and multiprocess-safe way. | |
static bool | remove (const ::std::wstring &pathname, const remove_mode mode=just_remove) |
static bool | remove (const wchar_t *pathname, const remove_mode mode=just_remove) |
static bool | remove (const ::std::string &pathname, const remove_mode mode=just_remove) |
static bool | remove (const char *pathname, const remove_mode mode=just_remove) |
Protected Member Functions inherited from mdbx::env | |
constexpr | env (MDBX_env *ptr) noexcept |
Protected Attributes inherited from mdbx::env | |
MDBX_env * | handle_ {nullptr} |
|
constexprdefaultnoexcept |
mdbx::env_managed::env_managed | ( | const ::mdbx::filesystem::path & | pathname, |
const operate_parameters & | , | ||
bool | accede = true |
||
) |
Open existing database.
mdbx::env_managed::env_managed | ( | const ::std::wstring & | pathname, |
const operate_parameters & | , | ||
bool | accede = true |
||
) |
|
explicit |
mdbx::env_managed::env_managed | ( | const ::std::string & | pathname, |
const operate_parameters & | , | ||
bool | accede = true |
||
) |
|
explicit |
mdbx::env_managed::env_managed | ( | const ::mdbx::filesystem::path & | pathname, |
const create_parameters & | , | ||
const operate_parameters & | , | ||
bool | accede = true |
||
) |
Create new or open existing database.
mdbx::env_managed::env_managed | ( | const ::std::wstring & | pathname, |
const create_parameters & | , | ||
const operate_parameters & | , | ||
bool | accede = true |
||
) |
|
explicit |
mdbx::env_managed::env_managed | ( | const ::std::string & | pathname, |
const create_parameters & | , | ||
const operate_parameters & | , | ||
bool | accede = true |
||
) |
|
explicit |
|
default |
|
delete |
|
virtualnoexcept |
void mdbx::env_managed::close | ( | bool | dont_sync = false | ) |
Explicitly closes the environment and release the memory map.
Only a single thread may call this function. All transactions, tables, and cursors must already be closed before calling this function. Attempts to use any such handles after calling this function will cause a SIGSEGV
. The environment handle will be freed and must not be used again after this call.
[in] | dont_sync | A dont'sync flag, if non-zero the last checkpoint will be kept "as is" and may be still "weak" in the lazy_weak_tail or whole_fragile modes. Such "weak" checkpoint will be ignored on opening next time, and transactions since the last non-weak checkpoint (meta-page update) will rolledback for consistency guarantee. |
|
delete |
|
inlinenoexcept |
class mdbx::txn |
Unmanaged database transaction.
Like other unmanaged classes, txn
allows copying and assignment for instances, but does not destroys the represented underlying object from the own class destructor.
All database operations require a transaction handle. Transactions may be read-only or read-write.
Inherited by mdbx::txn_managed.
Public Types | |
using | info = ::MDBX_txn_info |
using | map_stat = ::MDBX_stat |
using | canary = ::MDBX_canary |
Public Member Functions | |
constexpr | txn () noexcept=default |
txn (const txn &) noexcept=default | |
txn & | operator= (txn &&other) noexcept |
txn (txn &&other) noexcept | |
~txn () noexcept | |
constexpr | operator const MDBX_txn * () const |
constexpr | operator MDBX_txn * () |
inline ::mdbx::env | env () const noexcept |
Returns the transaction's environment. | |
MDBX_txn_flags_t | flags () const |
Returns transaction's flags. | |
uint64_t | id () const |
Return the transaction's ID. | |
void * | get_context () const noexcept |
Returns the application context associated with the transaction. | |
txn & | set_context (void *your_context) |
Sets the application context associated with the transaction. | |
bool | is_dirty (const void *ptr) const |
Checks whether the given data is on a dirty page. | |
bool | is_readonly () const |
Checks whether the transaction is read-only. | |
bool | is_readwrite () const |
Checks whether the transaction is read-write. | |
info | get_info (bool scan_reader_lock_table=false) const |
Returns information about the MDBX transaction. | |
size_t | size_max () const |
Returns maximal write transaction size (i.e. limit for summary volume of dirty pages) in bytes. | |
size_t | size_current () const |
Returns current write transaction size (i.e.summary volume of dirty pages) in bytes. | |
void | reset_reading () |
Reset read-only transaction. | |
void | renew_reading () |
Renew read-only transaction. | |
void | park_reading (bool autounpark=true) |
Park read-only transaction. | |
bool | unpark_reading (bool restart_if_ousted=true) |
Resume parked read-only transaction. | |
txn_managed | start_nested () |
Start nested write transaction. | |
cursor_managed | open_cursor (map_handle map) const |
Opens cursor for specified key-value map handle. | |
size_t | release_all_cursors (bool unbind) const |
Unbind or close all cursors. | |
size_t | close_all_cursors () const |
Close all cursors. | |
size_t | unbind_all_cursors () const |
Unbind all cursors. | |
map_handle | 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 | 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 | open_map (const ::mdbx::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 | open_map_accede (const char *name) const |
Open existing key-value map. | |
map_handle | open_map_accede (const ::std::string &name) const |
Open existing key-value map. | |
map_handle | open_map_accede (const ::mdbx::slice &name) const |
Open existing key-value map. | |
map_handle | 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. | |
map_handle | 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. | |
map_handle | create_map (const ::mdbx::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. | |
void | drop_map (map_handle map) |
Drops key-value map using handle. | |
bool | drop_map (const char *name, bool throw_if_absent=false) |
Drops key-value map using name. | |
bool | drop_map (const ::std::string &name, bool throw_if_absent=false) |
Drop key-value map. | |
bool | drop_map (const ::mdbx::slice &name, bool throw_if_absent=false) |
Drop key-value map. | |
void | clear_map (map_handle map) |
Clear key-value map. | |
bool | clear_map (const char *name, bool throw_if_absent=false) |
bool | clear_map (const ::std::string &name, bool throw_if_absent=false) |
bool | clear_map (const ::mdbx::slice &name, bool throw_if_absent=false) |
void | rename_map (map_handle map, const char *new_name) |
Переименовывает таблицу ключ-значение. | |
void | rename_map (map_handle map, const ::std::string &new_name) |
Переименовывает таблицу ключ-значение. | |
void | rename_map (map_handle map, const ::mdbx::slice &new_name) |
Переименовывает таблицу ключ-значение. | |
bool | rename_map (const char *old_name, const char *new_name, bool throw_if_absent=false) |
Переименовывает таблицу ключ-значение. | |
bool | rename_map (const ::std::string &old_name, const ::std::string &new_name, bool throw_if_absent=false) |
Переименовывает таблицу ключ-значение. | |
bool | rename_map (const ::mdbx::slice &old_name, const ::mdbx::slice &new_name, bool throw_if_absent=false) |
Переименовывает таблицу ключ-значение. | |
map_handle | open_map (const ::std::string_view &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 | open_map_accede (const ::std::string_view &name) const |
Open existing key-value map. | |
map_handle | create_map (const ::std::string_view &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 | drop_map (const ::std::string_view &name, bool throw_if_absent=false) |
Drop key-value map. | |
bool | clear_map (const ::std::string_view &name, bool throw_if_absent=false) |
void | rename_map (map_handle map, const ::std::string_view &new_name) |
Переименовывает таблицу ключ-значение. | |
bool | rename_map (const ::std::string_view &old_name, const ::std::string_view &new_name, bool throw_if_absent=false) |
Переименовывает таблицу ключ-значение. | |
map_stat | get_map_stat (map_handle map) const |
Returns statistics for a table. | |
uint32_t | get_tree_deepmask (map_handle map) const |
Returns depth (bitmask) information of nested dupsort (multi-value) B+trees for given table. | |
map_handle::info | get_handle_info (map_handle map) const |
Returns information about key-value map (aka table) handle. | |
txn & | put_canary (const canary &) |
Set integers markers (aka "canary") associated with the environment. | |
canary | get_canary () const |
Returns fours integers markers (aka "canary") associated with the environment. | |
uint64_t | sequence (map_handle map) const |
uint64_t | sequence (map_handle map, uint64_t increment) |
Reads and increment sequence generator associated with a key-value map (aka table). | |
int | 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 | 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 | 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 | 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 | get (map_handle map, const slice &key) const |
Get value by key from a key-value map (aka table). | |
slice | 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 | 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 | 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 | get_equal_or_great (map_handle map, const slice &key) const |
Get value for equal or great key from a table. | |
pair_result | 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 | put (map_handle map, const slice &key, slice *value, MDBX_put_flags_t flags) noexcept |
void | put (map_handle map, const slice &key, slice value, put_mode mode) |
void | insert (map_handle map, const slice &key, slice value) |
value_result | try_insert (map_handle map, const slice &key, slice value) |
slice | insert_reserve (map_handle map, const slice &key, size_t value_length) |
value_result | try_insert_reserve (map_handle map, const slice &key, size_t value_length) |
void | upsert (map_handle map, const slice &key, const slice &value) |
slice | upsert_reserve (map_handle map, const slice &key, size_t value_length) |
void | update (map_handle map, const slice &key, const slice &value) |
bool | try_update (map_handle map, const slice &key, const slice &value) |
slice | update_reserve (map_handle map, const slice &key, size_t value_length) |
value_result | try_update_reserve (map_handle map, const slice &key, size_t value_length) |
void | put (map_handle map, const pair &kv, put_mode mode) |
void | insert (map_handle map, const pair &kv) |
value_result | try_insert (map_handle map, const pair &kv) |
void | upsert (map_handle map, const pair &kv) |
bool | erase (map_handle map, const slice &key) |
Removes all values for given key. | |
bool | erase (map_handle map, const slice &key, const slice &value) |
Removes the particular multi-value entry of the key. | |
void | 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 ALLOCATOR , typename CAPACITY_POLICY > | |
buffer< ALLOCATOR, CAPACITY_POLICY > | extract (map_handle map, const slice &key, const typename buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type &allocator=buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type()) |
Removes and return a value of the key. | |
template<class ALLOCATOR , typename CAPACITY_POLICY > | |
buffer< ALLOCATOR, CAPACITY_POLICY > | replace (map_handle map, const slice &key, const slice &new_value, const typename buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type &allocator=buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type()) |
Replaces and returns a value of the key with new one. | |
template<class ALLOCATOR , typename CAPACITY_POLICY > | |
buffer< ALLOCATOR, CAPACITY_POLICY > | replace_reserve (map_handle map, const slice &key, slice &new_value, const typename buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type &allocator=buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type()) |
void | 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. | |
void | append (map_handle map, const pair &kv, bool multivalue_order_preserved=true) |
size_t | 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) |
template<typename VALUE > | |
size_t | put_multiple_samelength (map_handle map, const slice &key, const VALUE *values_array, size_t values_count, put_mode mode, bool allow_partial=false) |
template<typename VALUE > | |
void | put_multiple_samelength (map_handle map, const slice &key, const ::std::vector< VALUE > &vector, put_mode mode) |
ptrdiff_t | estimate (map_handle map, const pair &from, const pair &to) const |
ptrdiff_t | estimate (map_handle map, const slice &from, const slice &to) const |
ptrdiff_t | estimate_from_first (map_handle map, const slice &to) const |
ptrdiff_t | estimate_to_last (map_handle map, const slice &from) const |
Protected Member Functions | |
constexpr | txn (MDBX_txn *ptr) noexcept |
Protected Attributes | |
MDBX_txn * | handle_ {nullptr} |
Friends | |
class | cursor |
constexpr bool | operator== (const txn &a, const txn &b) noexcept |
constexpr bool | operator!= (const txn &a, const txn &b) noexcept |
using mdbx::txn::canary = ::MDBX_canary |
using mdbx::txn::info = ::MDBX_txn_info |
using mdbx::txn::map_stat = ::MDBX_stat |
|
constexprdefaultnoexcept |
|
defaultnoexcept |
|
inline |
bool mdbx::txn::clear_map | ( | const ::mdbx::slice & | name, |
bool | throw_if_absent = false |
||
) |
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.
|
inline |
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. bool mdbx::txn::clear_map | ( | const char * | name, |
bool | throw_if_absent = false |
||
) |
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.
|
inline |
Close all cursors.
|
inline |
Create new or open existing key-value map.
bool mdbx::txn::drop_map | ( | const ::mdbx::slice & | name, |
bool | throw_if_absent = false |
||
) |
Drop key-value map.
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.
|
inline |
Drop key-value map.
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. bool mdbx::txn::drop_map | ( | const char * | name, |
bool | throw_if_absent = false |
||
) |
Drops key-value map using name.
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.
|
inline |
|
inline |
Checks whether the transaction is read-only.
|
inline |
Checks whether the transaction is read-write.
|
inline |
Open existing key-value map.
|
inline |
Open existing key-value map.
|
inline |
|
inline |
|
inline |
bool mdbx::txn::rename_map | ( | const ::mdbx::slice & | old_name, |
const ::mdbx::slice & | new_name, | ||
bool | throw_if_absent = false |
||
) |
Переименовывает таблицу ключ-значение.
True
если таблица существует и была переименована, либо false
в случае отсутствия исходной таблицы. bool mdbx::txn::rename_map | ( | const ::std::string & | old_name, |
const ::std::string & | new_name, | ||
bool | throw_if_absent = false |
||
) |
Переименовывает таблицу ключ-значение.
True
если таблица существует и была переименована, либо false
в случае отсутствия исходной таблицы.
|
inline |
Переименовывает таблицу ключ-значение.
True
если таблица существует и была переименована, либо false
в случае отсутствия исходной таблицы. bool mdbx::txn::rename_map | ( | const char * | old_name, |
const char * | new_name, | ||
bool | throw_if_absent = false |
||
) |
Переименовывает таблицу ключ-значение.
True
если таблица существует и была переименована, либо false
в случае отсутствия исходной таблицы.
|
inline |
Переименовывает таблицу ключ-значение.
|
inline |
Returns current write transaction size (i.e.summary volume of dirty pages) in bytes.
|
inline |
Returns maximal write transaction size (i.e. limit for summary volume of dirty pages) in bytes.
txn_managed mdbx::txn::start_nested | ( | ) |
Start nested write transaction.
|
inline |
|
inline |
Unbind all cursors.
|
inline |
|
friend |
|
protected |
class mdbx::txn_managed |
Managed database transaction.
As other managed classes, txn_managed
destroys the represented underlying object from the own class destructor, but disallows copying and assignment for instances.
All database operations require a transaction handle. Transactions may be read-only or read-write.
Inherits mdbx::txn.
Public Types | |
using | commit_latency = MDBX_commit_latency |
Public Types inherited from mdbx::txn | |
using | info = ::MDBX_txn_info |
using | map_stat = ::MDBX_stat |
using | canary = ::MDBX_canary |
Public Member Functions | |
constexpr | txn_managed () noexcept=default |
txn_managed (txn_managed &&)=default | |
txn_managed & | operator= (txn_managed &&other) noexcept |
txn_managed (const txn_managed &)=delete | |
txn_managed & | operator= (const txn_managed &)=delete |
~txn_managed () noexcept | |
void | abort () |
Abandon all the operations of the transaction instead of saving ones. | |
void | commit () |
Commit all the operations of a transaction into the database. | |
void | commit_embark_read () |
Commit all the operations of a transaction into the database and then start read transaction. | |
void | commit (commit_latency *) |
Commit all the operations of a transaction into the database and collect latency information. | |
void | commit (commit_latency &latency) |
Commit all the operations of a transaction into the database and collect latency information. | |
commit_latency | commit_get_latency () |
Commit all the operations of a transaction into the database and return latency information. | |
Public Member Functions inherited from mdbx::txn | |
constexpr | txn () noexcept=default |
txn (const txn &) noexcept=default | |
txn & | operator= (txn &&other) noexcept |
txn (txn &&other) noexcept | |
~txn () noexcept | |
constexpr | operator const MDBX_txn * () const |
constexpr | operator MDBX_txn * () |
inline ::mdbx::env | env () const noexcept |
Returns the transaction's environment. | |
MDBX_txn_flags_t | flags () const |
Returns transaction's flags. | |
uint64_t | id () const |
Return the transaction's ID. | |
void * | get_context () const noexcept |
Returns the application context associated with the transaction. | |
txn & | set_context (void *your_context) |
Sets the application context associated with the transaction. | |
bool | is_dirty (const void *ptr) const |
Checks whether the given data is on a dirty page. | |
bool | is_readonly () const |
Checks whether the transaction is read-only. | |
bool | is_readwrite () const |
Checks whether the transaction is read-write. | |
info | get_info (bool scan_reader_lock_table=false) const |
Returns information about the MDBX transaction. | |
size_t | size_max () const |
Returns maximal write transaction size (i.e. limit for summary volume of dirty pages) in bytes. | |
size_t | size_current () const |
Returns current write transaction size (i.e.summary volume of dirty pages) in bytes. | |
void | reset_reading () |
Reset read-only transaction. | |
void | renew_reading () |
Renew read-only transaction. | |
void | park_reading (bool autounpark=true) |
Park read-only transaction. | |
bool | unpark_reading (bool restart_if_ousted=true) |
Resume parked read-only transaction. | |
txn_managed | start_nested () |
Start nested write transaction. | |
cursor_managed | open_cursor (map_handle map) const |
Opens cursor for specified key-value map handle. | |
size_t | release_all_cursors (bool unbind) const |
Unbind or close all cursors. | |
size_t | close_all_cursors () const |
Close all cursors. | |
size_t | unbind_all_cursors () const |
Unbind all cursors. | |
map_handle | 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 | 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 | open_map (const ::mdbx::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 | open_map_accede (const char *name) const |
Open existing key-value map. | |
map_handle | open_map_accede (const ::std::string &name) const |
Open existing key-value map. | |
map_handle | open_map_accede (const ::mdbx::slice &name) const |
Open existing key-value map. | |
map_handle | 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. | |
map_handle | 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. | |
map_handle | create_map (const ::mdbx::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. | |
void | drop_map (map_handle map) |
Drops key-value map using handle. | |
bool | drop_map (const char *name, bool throw_if_absent=false) |
Drops key-value map using name. | |
bool | drop_map (const ::std::string &name, bool throw_if_absent=false) |
Drop key-value map. | |
bool | drop_map (const ::mdbx::slice &name, bool throw_if_absent=false) |
Drop key-value map. | |
void | clear_map (map_handle map) |
Clear key-value map. | |
bool | clear_map (const char *name, bool throw_if_absent=false) |
bool | clear_map (const ::std::string &name, bool throw_if_absent=false) |
bool | clear_map (const ::mdbx::slice &name, bool throw_if_absent=false) |
void | rename_map (map_handle map, const char *new_name) |
Переименовывает таблицу ключ-значение. | |
void | rename_map (map_handle map, const ::std::string &new_name) |
Переименовывает таблицу ключ-значение. | |
void | rename_map (map_handle map, const ::mdbx::slice &new_name) |
Переименовывает таблицу ключ-значение. | |
bool | rename_map (const char *old_name, const char *new_name, bool throw_if_absent=false) |
Переименовывает таблицу ключ-значение. | |
bool | rename_map (const ::std::string &old_name, const ::std::string &new_name, bool throw_if_absent=false) |
Переименовывает таблицу ключ-значение. | |
bool | rename_map (const ::mdbx::slice &old_name, const ::mdbx::slice &new_name, bool throw_if_absent=false) |
Переименовывает таблицу ключ-значение. | |
map_handle | open_map (const ::std::string_view &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 | open_map_accede (const ::std::string_view &name) const |
Open existing key-value map. | |
map_handle | create_map (const ::std::string_view &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 | drop_map (const ::std::string_view &name, bool throw_if_absent=false) |
Drop key-value map. | |
bool | clear_map (const ::std::string_view &name, bool throw_if_absent=false) |
void | rename_map (map_handle map, const ::std::string_view &new_name) |
Переименовывает таблицу ключ-значение. | |
bool | rename_map (const ::std::string_view &old_name, const ::std::string_view &new_name, bool throw_if_absent=false) |
Переименовывает таблицу ключ-значение. | |
map_stat | get_map_stat (map_handle map) const |
Returns statistics for a table. | |
uint32_t | get_tree_deepmask (map_handle map) const |
Returns depth (bitmask) information of nested dupsort (multi-value) B+trees for given table. | |
map_handle::info | get_handle_info (map_handle map) const |
Returns information about key-value map (aka table) handle. | |
txn & | put_canary (const canary &) |
Set integers markers (aka "canary") associated with the environment. | |
canary | get_canary () const |
Returns fours integers markers (aka "canary") associated with the environment. | |
uint64_t | sequence (map_handle map) const |
uint64_t | sequence (map_handle map, uint64_t increment) |
Reads and increment sequence generator associated with a key-value map (aka table). | |
int | 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 | 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 | 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 | 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 | get (map_handle map, const slice &key) const |
Get value by key from a key-value map (aka table). | |
slice | 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 | 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 | 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 | get_equal_or_great (map_handle map, const slice &key) const |
Get value for equal or great key from a table. | |
pair_result | 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 | put (map_handle map, const slice &key, slice *value, MDBX_put_flags_t flags) noexcept |
void | put (map_handle map, const slice &key, slice value, put_mode mode) |
void | insert (map_handle map, const slice &key, slice value) |
value_result | try_insert (map_handle map, const slice &key, slice value) |
slice | insert_reserve (map_handle map, const slice &key, size_t value_length) |
value_result | try_insert_reserve (map_handle map, const slice &key, size_t value_length) |
void | upsert (map_handle map, const slice &key, const slice &value) |
slice | upsert_reserve (map_handle map, const slice &key, size_t value_length) |
void | update (map_handle map, const slice &key, const slice &value) |
bool | try_update (map_handle map, const slice &key, const slice &value) |
slice | update_reserve (map_handle map, const slice &key, size_t value_length) |
value_result | try_update_reserve (map_handle map, const slice &key, size_t value_length) |
void | put (map_handle map, const pair &kv, put_mode mode) |
void | insert (map_handle map, const pair &kv) |
value_result | try_insert (map_handle map, const pair &kv) |
void | upsert (map_handle map, const pair &kv) |
bool | erase (map_handle map, const slice &key) |
Removes all values for given key. | |
bool | erase (map_handle map, const slice &key, const slice &value) |
Removes the particular multi-value entry of the key. | |
void | 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 ALLOCATOR , typename CAPACITY_POLICY > | |
buffer< ALLOCATOR, CAPACITY_POLICY > | extract (map_handle map, const slice &key, const typename buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type &allocator=buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type()) |
Removes and return a value of the key. | |
template<class ALLOCATOR , typename CAPACITY_POLICY > | |
buffer< ALLOCATOR, CAPACITY_POLICY > | replace (map_handle map, const slice &key, const slice &new_value, const typename buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type &allocator=buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type()) |
Replaces and returns a value of the key with new one. | |
template<class ALLOCATOR , typename CAPACITY_POLICY > | |
buffer< ALLOCATOR, CAPACITY_POLICY > | replace_reserve (map_handle map, const slice &key, slice &new_value, const typename buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type &allocator=buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type()) |
void | 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. | |
void | append (map_handle map, const pair &kv, bool multivalue_order_preserved=true) |
size_t | 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) |
template<typename VALUE > | |
size_t | put_multiple_samelength (map_handle map, const slice &key, const VALUE *values_array, size_t values_count, put_mode mode, bool allow_partial=false) |
template<typename VALUE > | |
void | put_multiple_samelength (map_handle map, const slice &key, const ::std::vector< VALUE > &vector, put_mode mode) |
ptrdiff_t | estimate (map_handle map, const pair &from, const pair &to) const |
ptrdiff_t | estimate (map_handle map, const slice &from, const slice &to) const |
ptrdiff_t | estimate_from_first (map_handle map, const slice &to) const |
ptrdiff_t | estimate_to_last (map_handle map, const slice &from) const |
Friends | |
class | env |
class | txn |
Additional Inherited Members | |
Protected Member Functions inherited from mdbx::txn | |
constexpr | txn (MDBX_txn *ptr) noexcept |
Protected Attributes inherited from mdbx::txn | |
MDBX_txn * | handle_ {nullptr} |
|
constexprdefaultnoexcept |
|
default |
|
delete |
|
noexcept |
void mdbx::txn_managed::abort | ( | ) |
Abandon all the operations of the transaction instead of saving ones.
void mdbx::txn_managed::commit | ( | ) |
Commit all the operations of a transaction into the database.
|
inline |
Commit all the operations of a transaction into the database and collect latency information.
void mdbx::txn_managed::commit | ( | commit_latency * | ) |
Commit all the operations of a transaction into the database and collect latency information.
void mdbx::txn_managed::commit_embark_read | ( | ) |
Commit all the operations of a transaction into the database and then start read transaction.
|
inline |
Commit all the operations of a transaction into the database and return latency information.
|
delete |
|
inlinenoexcept |
|
friend |
|
friend |
class mdbx::cursor |
Unmanaged cursor.
Like other unmanaged classes, cursor
allows copying and assignment for instances, but does not destroys the represented underlying object from the own class destructor.
Inherited by mdbx::cursor_managed.
Public Types | |
enum | move_operation { first = MDBX_FIRST , last = MDBX_LAST , next = MDBX_NEXT , previous = MDBX_PREV , get_current = MDBX_GET_CURRENT , multi_prevkey_lastvalue = MDBX_PREV_NODUP , multi_currentkey_firstvalue = MDBX_FIRST_DUP , multi_currentkey_prevvalue = MDBX_PREV_DUP , multi_currentkey_nextvalue = MDBX_NEXT_DUP , multi_currentkey_lastvalue = MDBX_LAST_DUP , multi_nextkey_firstvalue = MDBX_NEXT_NODUP , multi_find_pair = MDBX_GET_BOTH , multi_exactkey_lowerboundvalue = MDBX_GET_BOTH_RANGE , seek_key = MDBX_SET , key_exact = MDBX_SET_KEY , key_lowerbound = MDBX_SET_RANGE , key_lesser_than = MDBX_TO_KEY_LESSER_THAN , key_lesser_or_equal = MDBX_TO_KEY_LESSER_OR_EQUAL , key_equal = MDBX_TO_KEY_EQUAL , key_greater_or_equal = MDBX_TO_KEY_GREATER_OR_EQUAL , key_greater_than = MDBX_TO_KEY_GREATER_THAN , multi_exactkey_value_lesser_than = MDBX_TO_EXACT_KEY_VALUE_LESSER_THAN , multi_exactkey_value_lesser_or_equal , multi_exactkey_value_equal = MDBX_TO_EXACT_KEY_VALUE_EQUAL , multi_exactkey_value_greater_or_equal , multi_exactkey_value_greater = MDBX_TO_EXACT_KEY_VALUE_GREATER_THAN , pair_lesser_than = MDBX_TO_PAIR_LESSER_THAN , pair_lesser_or_equal = MDBX_TO_PAIR_LESSER_OR_EQUAL , pair_equal = MDBX_TO_PAIR_EQUAL , pair_exact = pair_equal , pair_greater_or_equal = MDBX_TO_PAIR_GREATER_OR_EQUAL , pair_greater_than = MDBX_TO_PAIR_GREATER_THAN , batch_samelength = MDBX_GET_MULTIPLE , batch_samelength_next = MDBX_NEXT_MULTIPLE , batch_samelength_previous = MDBX_PREV_MULTIPLE } |
Public Member Functions | |
constexpr | cursor () noexcept=default |
cursor (const cursor &) noexcept=default | |
cursor & | operator= (cursor &&other) noexcept |
cursor (cursor &&other) noexcept | |
~cursor () noexcept | |
cursor_managed | clone (void *your_context=nullptr) const |
constexpr | operator const MDBX_cursor * () const |
constexpr | operator MDBX_cursor * () |
bool | is_before_than (const cursor &other, bool ignore_nested=false) const |
bool | is_same_or_before_than (const cursor &other, bool ignore_nested=false) const |
bool | is_same_position (const cursor &other, bool ignore_nested=false) const |
bool | is_after_than (const cursor &other, bool ignore_nested=false) const |
bool | is_same_or_after_than (const cursor &other, bool ignore_nested=false) const |
void * | get_context () const noexcept |
Returns the application context associated with the cursor. | |
cursor & | set_context (void *your_context) |
Sets the application context associated with the cursor. | |
template<typename CALLABLE_PREDICATE > | |
bool | scan (CALLABLE_PREDICATE predicate, move_operation start=first, move_operation turn=next) |
template<typename CALLABLE_PREDICATE > | |
bool | fullscan (CALLABLE_PREDICATE predicate, bool backward=false) |
template<typename CALLABLE_PREDICATE > | |
bool | scan_from (CALLABLE_PREDICATE predicate, slice &from, move_operation start=key_greater_or_equal, move_operation turn=next) |
template<typename CALLABLE_PREDICATE > | |
bool | scan_from (CALLABLE_PREDICATE predicate, pair &from, move_operation start=pair_greater_or_equal, move_operation turn=next) |
move_result | move (move_operation operation, bool throw_notfound) |
move_result | move (move_operation operation, const slice &key, bool throw_notfound) |
move_result | move (move_operation operation, const slice &key, const slice &value, bool throw_notfound) |
bool | move (move_operation operation, slice &key, slice &value, bool throw_notfound) |
move_result | to_first (bool throw_notfound=true) |
move_result | to_previous (bool throw_notfound=true) |
move_result | to_previous_last_multi (bool throw_notfound=true) |
move_result | to_current_first_multi (bool throw_notfound=true) |
move_result | to_current_prev_multi (bool throw_notfound=true) |
move_result | current (bool throw_notfound=true) const |
move_result | to_current_next_multi (bool throw_notfound=true) |
move_result | to_current_last_multi (bool throw_notfound=true) |
move_result | to_next_first_multi (bool throw_notfound=true) |
move_result | to_next (bool throw_notfound=true) |
move_result | to_last (bool throw_notfound=true) |
move_result | to_key_lesser_than (const slice &key, bool throw_notfound=true) |
move_result | to_key_lesser_or_equal (const slice &key, bool throw_notfound=true) |
move_result | to_key_equal (const slice &key, bool throw_notfound=true) |
move_result | to_key_exact (const slice &key, bool throw_notfound=true) |
move_result | to_key_greater_or_equal (const slice &key, bool throw_notfound=true) |
move_result | to_key_greater_than (const slice &key, bool throw_notfound=true) |
move_result | to_exact_key_value_lesser_than (const slice &key, const slice &value, bool throw_notfound=true) |
move_result | to_exact_key_value_lesser_or_equal (const slice &key, const slice &value, bool throw_notfound=true) |
move_result | to_exact_key_value_equal (const slice &key, const slice &value, bool throw_notfound=true) |
move_result | to_exact_key_value_greater_or_equal (const slice &key, const slice &value, bool throw_notfound=true) |
move_result | to_exact_key_value_greater_than (const slice &key, const slice &value, bool throw_notfound=true) |
move_result | to_pair_lesser_than (const slice &key, const slice &value, bool throw_notfound=true) |
move_result | to_pair_lesser_or_equal (const slice &key, const slice &value, bool throw_notfound=true) |
move_result | to_pair_equal (const slice &key, const slice &value, bool throw_notfound=true) |
move_result | to_pair_exact (const slice &key, const slice &value, bool throw_notfound=true) |
move_result | to_pair_greater_or_equal (const slice &key, const slice &value, bool throw_notfound=true) |
move_result | to_pair_greater_than (const slice &key, const slice &value, bool throw_notfound=true) |
bool | seek (const slice &key) |
move_result | find (const slice &key, bool throw_notfound=true) |
move_result | lower_bound (const slice &key, bool throw_notfound=false) |
move_result | upper_bound (const slice &key, bool throw_notfound=false) |
size_t | count_multivalue () const |
Return count of duplicates for current key. | |
move_result | find_multivalue (const slice &key, const slice &value, bool throw_notfound=true) |
move_result | lower_bound_multivalue (const slice &key, const slice &value, bool throw_notfound=false) |
move_result | upper_bound_multivalue (const slice &key, const slice &value, bool throw_notfound=false) |
move_result | get_multiple_samelength (const slice &key, bool throw_notfound=true) |
move_result | get_multiple_samelength (bool throw_notfound=false) |
move_result | next_multiple_samelength (bool throw_notfound=false) |
move_result | previous_multiple_samelength (bool throw_notfound=false) |
bool | eof () const |
bool | on_first () const |
bool | on_last () const |
bool | on_first_multival () const |
bool | on_last_multival () const |
estimate_result | estimate (const slice &key, const slice &value) const |
estimate_result | estimate (const slice &key) const |
estimate_result | estimate (move_operation operation) const |
estimate_result | estimate (move_operation operation, slice &key) const |
void | renew (const ::mdbx::txn &txn) |
Renew/bind a cursor with a new transaction and previously used key-value map handle. | |
void | bind (const ::mdbx::txn &txn, ::mdbx::map_handle map_handle) |
Bind/renew a cursor with a new transaction and specified key-value map handle. | |
void | unbind () |
Unbind cursor from a transaction. | |
inline ::mdbx::txn | txn () const |
Returns the cursor's transaction. | |
map_handle | map () const |
operator::mdbx::txn () const | |
operator::mdbx::map_handle () const | |
MDBX_error_t | put (const slice &key, slice *value, MDBX_put_flags_t flags) noexcept |
void | put (const slice &key, slice value, put_mode mode) |
void | insert (const slice &key, slice value) |
value_result | try_insert (const slice &key, slice value) |
slice | insert_reserve (const slice &key, size_t value_length) |
value_result | try_insert_reserve (const slice &key, size_t value_length) |
void | upsert (const slice &key, const slice &value) |
slice | upsert_reserve (const slice &key, size_t value_length) |
void | update (const slice &key, const slice &value) |
bool | try_update (const slice &key, const slice &value) |
slice | update_reserve (const slice &key, size_t value_length) |
value_result | try_update_reserve (const slice &key, size_t value_length) |
void | put (const pair &kv, put_mode mode) |
void | insert (const pair &kv) |
value_result | try_insert (const pair &kv) |
void | upsert (const pair &kv) |
bool | erase (bool whole_multivalue=false) |
Removes single key-value pair or all multi-values at the current cursor position. | |
bool | erase (const slice &key, bool whole_multivalue=true) |
Seeks and removes first value or whole multi-value of the given key. | |
bool | erase (const slice &key, const slice &value) |
Seeks and removes the particular multi-value entry of the key. | |
Protected Member Functions | |
constexpr | cursor (MDBX_cursor *ptr) noexcept |
bool | move (move_operation operation, MDBX_val *key, MDBX_val *value, bool throw_notfound) const |
ptrdiff_t | estimate (move_operation operation, MDBX_val *key, MDBX_val *value) const |
Protected Attributes | |
MDBX_cursor * | handle_ {nullptr} |
Friends | |
constexpr bool | operator== (const cursor &a, const cursor &b) noexcept |
constexpr bool | operator!= (const cursor &a, const cursor &b) noexcept |
int | compare_position_nothrow (const cursor &left, const cursor &right, bool ignore_nested) noexcept |
int | compare_position (const cursor &left, const cursor &right, bool ignore_nested) |
|
constexprdefaultnoexcept |
|
defaultnoexcept |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
friend |
|
friend |
|
protected |
class mdbx::cursor_managed |
Managed cursor.
As other managed classes, cursor_managed
destroys the represented underlying object from the own class destructor, but disallows copying and assignment for instances.
Inherits mdbx::cursor.
Public Member Functions | |
cursor_managed (void *your_context=nullptr) | |
Creates a new managed cursor with underlying object. | |
void | close () |
Explicitly closes the cursor. | |
cursor_managed (cursor_managed &&)=default | |
cursor_managed & | operator= (cursor_managed &&other) noexcept |
cursor_managed (const cursor_managed &)=delete | |
cursor_managed & | operator= (const cursor_managed &)=delete |
~cursor_managed () noexcept | |
Public Member Functions inherited from mdbx::cursor | |
constexpr | cursor () noexcept=default |
cursor (const cursor &) noexcept=default | |
cursor & | operator= (cursor &&other) noexcept |
cursor (cursor &&other) noexcept | |
~cursor () noexcept | |
cursor_managed | clone (void *your_context=nullptr) const |
constexpr | operator const MDBX_cursor * () const |
constexpr | operator MDBX_cursor * () |
bool | is_before_than (const cursor &other, bool ignore_nested=false) const |
bool | is_same_or_before_than (const cursor &other, bool ignore_nested=false) const |
bool | is_same_position (const cursor &other, bool ignore_nested=false) const |
bool | is_after_than (const cursor &other, bool ignore_nested=false) const |
bool | is_same_or_after_than (const cursor &other, bool ignore_nested=false) const |
void * | get_context () const noexcept |
Returns the application context associated with the cursor. | |
cursor & | set_context (void *your_context) |
Sets the application context associated with the cursor. | |
template<typename CALLABLE_PREDICATE > | |
bool | scan (CALLABLE_PREDICATE predicate, move_operation start=first, move_operation turn=next) |
template<typename CALLABLE_PREDICATE > | |
bool | fullscan (CALLABLE_PREDICATE predicate, bool backward=false) |
template<typename CALLABLE_PREDICATE > | |
bool | scan_from (CALLABLE_PREDICATE predicate, slice &from, move_operation start=key_greater_or_equal, move_operation turn=next) |
template<typename CALLABLE_PREDICATE > | |
bool | scan_from (CALLABLE_PREDICATE predicate, pair &from, move_operation start=pair_greater_or_equal, move_operation turn=next) |
move_result | move (move_operation operation, bool throw_notfound) |
move_result | move (move_operation operation, const slice &key, bool throw_notfound) |
move_result | move (move_operation operation, const slice &key, const slice &value, bool throw_notfound) |
bool | move (move_operation operation, slice &key, slice &value, bool throw_notfound) |
move_result | to_first (bool throw_notfound=true) |
move_result | to_previous (bool throw_notfound=true) |
move_result | to_previous_last_multi (bool throw_notfound=true) |
move_result | to_current_first_multi (bool throw_notfound=true) |
move_result | to_current_prev_multi (bool throw_notfound=true) |
move_result | current (bool throw_notfound=true) const |
move_result | to_current_next_multi (bool throw_notfound=true) |
move_result | to_current_last_multi (bool throw_notfound=true) |
move_result | to_next_first_multi (bool throw_notfound=true) |
move_result | to_next (bool throw_notfound=true) |
move_result | to_last (bool throw_notfound=true) |
move_result | to_key_lesser_than (const slice &key, bool throw_notfound=true) |
move_result | to_key_lesser_or_equal (const slice &key, bool throw_notfound=true) |
move_result | to_key_equal (const slice &key, bool throw_notfound=true) |
move_result | to_key_exact (const slice &key, bool throw_notfound=true) |
move_result | to_key_greater_or_equal (const slice &key, bool throw_notfound=true) |
move_result | to_key_greater_than (const slice &key, bool throw_notfound=true) |
move_result | to_exact_key_value_lesser_than (const slice &key, const slice &value, bool throw_notfound=true) |
move_result | to_exact_key_value_lesser_or_equal (const slice &key, const slice &value, bool throw_notfound=true) |
move_result | to_exact_key_value_equal (const slice &key, const slice &value, bool throw_notfound=true) |
move_result | to_exact_key_value_greater_or_equal (const slice &key, const slice &value, bool throw_notfound=true) |
move_result | to_exact_key_value_greater_than (const slice &key, const slice &value, bool throw_notfound=true) |
move_result | to_pair_lesser_than (const slice &key, const slice &value, bool throw_notfound=true) |
move_result | to_pair_lesser_or_equal (const slice &key, const slice &value, bool throw_notfound=true) |
move_result | to_pair_equal (const slice &key, const slice &value, bool throw_notfound=true) |
move_result | to_pair_exact (const slice &key, const slice &value, bool throw_notfound=true) |
move_result | to_pair_greater_or_equal (const slice &key, const slice &value, bool throw_notfound=true) |
move_result | to_pair_greater_than (const slice &key, const slice &value, bool throw_notfound=true) |
bool | seek (const slice &key) |
move_result | find (const slice &key, bool throw_notfound=true) |
move_result | lower_bound (const slice &key, bool throw_notfound=false) |
move_result | upper_bound (const slice &key, bool throw_notfound=false) |
size_t | count_multivalue () const |
Return count of duplicates for current key. | |
move_result | find_multivalue (const slice &key, const slice &value, bool throw_notfound=true) |
move_result | lower_bound_multivalue (const slice &key, const slice &value, bool throw_notfound=false) |
move_result | upper_bound_multivalue (const slice &key, const slice &value, bool throw_notfound=false) |
move_result | get_multiple_samelength (const slice &key, bool throw_notfound=true) |
move_result | get_multiple_samelength (bool throw_notfound=false) |
move_result | next_multiple_samelength (bool throw_notfound=false) |
move_result | previous_multiple_samelength (bool throw_notfound=false) |
bool | eof () const |
bool | on_first () const |
bool | on_last () const |
bool | on_first_multival () const |
bool | on_last_multival () const |
estimate_result | estimate (const slice &key, const slice &value) const |
estimate_result | estimate (const slice &key) const |
estimate_result | estimate (move_operation operation) const |
estimate_result | estimate (move_operation operation, slice &key) const |
void | renew (const ::mdbx::txn &txn) |
Renew/bind a cursor with a new transaction and previously used key-value map handle. | |
void | bind (const ::mdbx::txn &txn, ::mdbx::map_handle map_handle) |
Bind/renew a cursor with a new transaction and specified key-value map handle. | |
void | unbind () |
Unbind cursor from a transaction. | |
inline ::mdbx::txn | txn () const |
Returns the cursor's transaction. | |
map_handle | map () const |
operator::mdbx::txn () const | |
operator::mdbx::map_handle () const | |
MDBX_error_t | put (const slice &key, slice *value, MDBX_put_flags_t flags) noexcept |
void | put (const slice &key, slice value, put_mode mode) |
void | insert (const slice &key, slice value) |
value_result | try_insert (const slice &key, slice value) |
slice | insert_reserve (const slice &key, size_t value_length) |
value_result | try_insert_reserve (const slice &key, size_t value_length) |
void | upsert (const slice &key, const slice &value) |
slice | upsert_reserve (const slice &key, size_t value_length) |
void | update (const slice &key, const slice &value) |
bool | try_update (const slice &key, const slice &value) |
slice | update_reserve (const slice &key, size_t value_length) |
value_result | try_update_reserve (const slice &key, size_t value_length) |
void | put (const pair &kv, put_mode mode) |
void | insert (const pair &kv) |
value_result | try_insert (const pair &kv) |
void | upsert (const pair &kv) |
bool | erase (bool whole_multivalue=false) |
Removes single key-value pair or all multi-values at the current cursor position. | |
bool | erase (const slice &key, bool whole_multivalue=true) |
Seeks and removes first value or whole multi-value of the given key. | |
bool | erase (const slice &key, const slice &value) |
Seeks and removes the particular multi-value entry of the key. | |
Friends | |
class | txn |
Additional Inherited Members | |
Public Types inherited from mdbx::cursor | |
enum | move_operation { first = MDBX_FIRST , last = MDBX_LAST , next = MDBX_NEXT , previous = MDBX_PREV , get_current = MDBX_GET_CURRENT , multi_prevkey_lastvalue = MDBX_PREV_NODUP , multi_currentkey_firstvalue = MDBX_FIRST_DUP , multi_currentkey_prevvalue = MDBX_PREV_DUP , multi_currentkey_nextvalue = MDBX_NEXT_DUP , multi_currentkey_lastvalue = MDBX_LAST_DUP , multi_nextkey_firstvalue = MDBX_NEXT_NODUP , multi_find_pair = MDBX_GET_BOTH , multi_exactkey_lowerboundvalue = MDBX_GET_BOTH_RANGE , seek_key = MDBX_SET , key_exact = MDBX_SET_KEY , key_lowerbound = MDBX_SET_RANGE , key_lesser_than = MDBX_TO_KEY_LESSER_THAN , key_lesser_or_equal = MDBX_TO_KEY_LESSER_OR_EQUAL , key_equal = MDBX_TO_KEY_EQUAL , key_greater_or_equal = MDBX_TO_KEY_GREATER_OR_EQUAL , key_greater_than = MDBX_TO_KEY_GREATER_THAN , multi_exactkey_value_lesser_than = MDBX_TO_EXACT_KEY_VALUE_LESSER_THAN , multi_exactkey_value_lesser_or_equal , multi_exactkey_value_equal = MDBX_TO_EXACT_KEY_VALUE_EQUAL , multi_exactkey_value_greater_or_equal , multi_exactkey_value_greater = MDBX_TO_EXACT_KEY_VALUE_GREATER_THAN , pair_lesser_than = MDBX_TO_PAIR_LESSER_THAN , pair_lesser_or_equal = MDBX_TO_PAIR_LESSER_OR_EQUAL , pair_equal = MDBX_TO_PAIR_EQUAL , pair_exact = pair_equal , pair_greater_or_equal = MDBX_TO_PAIR_GREATER_OR_EQUAL , pair_greater_than = MDBX_TO_PAIR_GREATER_THAN , batch_samelength = MDBX_GET_MULTIPLE , batch_samelength_next = MDBX_NEXT_MULTIPLE , batch_samelength_previous = MDBX_PREV_MULTIPLE } |
Protected Member Functions inherited from mdbx::cursor | |
constexpr | cursor (MDBX_cursor *ptr) noexcept |
bool | move (move_operation operation, MDBX_val *key, MDBX_val *value, bool throw_notfound) const |
ptrdiff_t | estimate (move_operation operation, MDBX_val *key, MDBX_val *value) const |
Protected Attributes inherited from mdbx::cursor | |
MDBX_cursor * | handle_ {nullptr} |
|
inline |
Creates a new managed cursor with underlying object.
|
default |
|
delete |
|
inlinenoexcept |
void mdbx::cursor_managed::close | ( | ) |
Explicitly closes the cursor.
|
delete |
|
inlinenoexcept |
|
friend |
struct std::hash<::mdbx::slice > |
Public Member Functions | |
constexpr size_t | operator() (::mdbx::slice const &slice) const noexcept |
|
inlineconstexprnoexcept |
#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
.
using mdbx::build_info = typedef ::MDBX_build_info |
libmdbx build information
using mdbx::byte = typedef char8_t |
using mdbx::comparator = typedef ::MDBX_cmp_func * |
using mdbx::default_allocator = typedef polymorphic_allocator |
using mdbx::default_buffer = typedef buffer<default_allocator, default_capacity_policy> |
Default buffer.
using mdbx::duration = typedef ::std::chrono::duration<unsigned, ::std::ratio<1, 65536> > |
Duration in 1/65536 units of second.
using mdbx::filehandle = typedef ::mdbx_filehandle_t |
using mdbx::legacy_allocator = typedef ::std::string::allocator_type |
Legacy allocator but it is recommended to use polymorphic_allocator.
using mdbx::path = typedef ::mdbx::filesystem::path |
using mdbx::polymorphic_allocator = typedef ::std::pmr::string::allocator_type |
Default polymorphic allocator for modern code.
using mdbx::string = typedef ::std::basic_string<char, ::std::char_traits<char>, ALLOCATOR> |
Default single-byte string.
using mdbx::version_info = typedef ::MDBX_version_info |
libmdbx version information
|
strong |
Kinds of the keys and corresponding modes of comparing it.
Enumerator | |
---|---|
usual | Usual variable length keys with byte-by-byte lexicographic comparison like |
reverse | Variable length keys with byte-by-byte lexicographic comparison in reverse order, from the end of the keys to the beginning. |
ordinal | Keys are binary integers in native byte order, either |
msgpack | Keys are in MessagePack format with appropriate comparison.
|
enum mdbx::loop_control |
Loop control constants for readers enumeration functor and other cases.
Enumerator | |
---|---|
continue_loop | |
exit_loop |
enum mdbx::put_mode |
|
strong |
Kind of the values and sorted multi-values with corresponding comparison.
Enumerator | |
---|---|
single | Usual single value for each key. In terms of keys, they are unique. |
multi | A more than one data value could be associated with each key. Internally each key is stored once, and the corresponding data values are sorted by byte-by-byte lexicographic comparison like |
multi_reverse | A more than one data value could be associated with each key. Internally each key is stored once, and the corresponding data values are sorted by byte-by-byte lexicographic comparison in reverse order, from the end of the keys to the beginning. In terms of keys, they are not unique, i.e. has duplicates which are sorted by associated data values. |
multi_samelength | A more than one data value could be associated with each key, and all data values must be same length. Internally each key is stored once, and the corresponding data values are sorted by byte-by-byte lexicographic comparison like |
multi_ordinal | A more than one data value could be associated with each key, and all data values are binary integers in native byte order, either |
multi_reverse_samelength | A more than one data value could be associated with each key, and all data values must be same length. Internally each key is stored once, and the corresponding data values are sorted by byte-by-byte lexicographic comparison in reverse order, from the end of the keys to the beginning. In terms of keys, they are not unique, i.e. has duplicates which are sorted by associated data values. |
msgpack | A more than one data value could be associated with each key. Values are in MessagePack format with appropriate comparison. Internally each key is stored once, and the corresponding data values are sorted. In terms of keys, they are not unique, i.e. has duplicates which are sorted by associated data values.
|
|
inline |
|
inlinenoexcept |
|
constexprprotectednoexcept |
|
inlinenoexcept |
|
constexprprotectednoexcept |
|
constexprnoexcept |
|
inline |
|
constexprnoexcept |
|
inline |
|
inline |
|
constexprnoexcept |
|
constexprnoexcept |
Create an empty slice.
Create a slice that refers to c_str[0,strlen(c_str)-1].
Create a slice that refers to [begin,end] of memory bytes.
Create a slice that refers to [0,bytes-1] of memory bytes pointed by ptr.
|
constexprprotectednoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
Alter environment flags.
|
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.
[in] | map | A map handle to append |
[in] | key | A key to be append |
[in] | value | A value to store with the key |
[in] | multivalue_order_preserved | If multivalue_order_preserved == true then the same rules applied for to pages of nested b+tree of multimap's values. |
|
inline |
Returns a string with a Base58 dump of the slice content.
|
inline |
Returns a string with a Base58 dump of the slice content.
|
inline |
Returns a string with a hexadecimal dump of the slice content.
|
inline |
|
inline |
Returns the nth byte in the referenced data with bounds checking.
std::out_of_range | if n >= size() |
|
inline |
Decodes Base58 dump from the slice content to returned buffer.
|
inline |
Decodes Base64 dump from the slice content to returned buffer.
|
inline |
Bind/renew a cursor with a new transaction and specified key-value map handle.
|
inlinestatic |
|
inlinestatic |
|
constexprnoexcept |
Returns casted to pointer to byte an address of data.
|
constexprnoexcept |
|
inlinenoexcept |
Returns casted to pointer to char an address of data.
|
inline |
Checks for stale readers in the lock table and return number of cleared slots.
Makes the slice empty and referencing to nothing.
|
inline |
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.
|
inline |
Clear key-value map.
|
inline |
|
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.
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).
|
constexprnoexcept |
Returns error code.
|
staticconstexprnoexcept |
Three-way fast non-lexicographically length-based comparison.
|
staticconstexprnoexcept |
Three-way fast non-lexicographically length-based comparison.
Firstly compares length and if it equal then compare content lexicographically.
== 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
.
|
inlinenoexcept |
Compare keys of two pairs according to a particular key-value map (aka table).
|
inlinenoexcept |
Compare two keys according to a particular key-value map (aka table).
|
staticconstexprnoexcept |
Three-way lexicographically comparison.
|
staticconstexprnoexcept |
Three-way lexicographically comparison.
== 0
if a
lexicographically equal b
; < 0
if a
lexicographically less than b
; > 0
if a
lexicographically great than b
.
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
Compare values of two pairs according to a particular key-value map (aka table).
|
inlinenoexcept |
Compare two values according to a particular key-value map (aka table).
|
inline |
Return count of duplicates for current key.
|
inline |
Create new or open existing key-value map.
|
inline |
Create new or open existing key-value map.
|
inline |
Create new or open existing key-value map.
Return a pointer to the beginning of the referenced data.
|
inlinestatic |
Returns the maximal database size in bytes for specified page size.
|
inlinestatic |
Returns the minimal database size in bytes for specified page size.
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
Drop key-value map.
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.
|
inline |
Drops key-value map using handle.
|
constexprnoexcept |
Checks whether the slice is empty.
|
inline |
Returns a buffer with a Base58 dump of the slice content.
|
inline |
Returns a buffer with a Base64 dump of the slice content.
|
inline |
Returns a buffer with a hexadecimal dump of the slice content.
Return a pointer to the ending of the referenced data.
|
constexprnoexcept |
Returns casted to pointer to byte an end of data.
|
constexprnoexcept |
Returns casted to pointer to char an end of data.
Checks if the data ends with the given suffix.
|
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.
|
inlinenoexcept |
Returns the transaction's environment.
|
inline |
|
inline |
Removes single key-value pair or all multi-values at the current cursor position.
|
inline |
Seeks and removes first value or whole multi-value of the given key.
True
if the key is found and a value(s) is removed. Seeks and removes the particular multi-value entry of the key.
True
if the given key-value pair is found and removed.
|
inline |
Removes all values for given key.
|
inline |
Removes the particular multi-value entry of the key.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineprotected |
|
inline |
|
inline |
|
inline |
Gets the value of extra runtime options from an environment.
|
inline |
Removes and return a value of the key.
|
inline |
|
inline |
|
inline |
Returns transaction's flags.
|
inline |
Get value by key from a key-value map (aka table).
|
inline |
Get value by key from a key-value map (aka table).
|
inline |
Get first of multi-value and values count by key from a key-value multimap (aka table).
|
inline |
Get first of multi-value and values count by key from a key-value multimap (aka table).
|
constexprnoexcept |
Returns libmdbx build information.
|
inline |
Returns fours integers markers (aka "canary") associated with the environment.
|
inlinenoexcept |
Returns the application context associated with the environment.
|
inlinenoexcept |
Returns the application context associated with the transaction.
|
inlinenoexcept |
Returns the application context associated with the cursor.
|
inline |
Returns current durability mode.
|
inline |
Get value for equal or great key from a table.
true
if the exact key was found and false
otherwise.
|
inline |
Get value for equal or great key from a table.
true
if the exact key was found and false
otherwise.
|
inline |
Returns the file descriptor for the DXB file of MDBX environment.
|
inline |
Returns environment flags.
|
inline |
Returns information about key-value map (aka table) handle.
|
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.
|
inline |
Return snapshot information about the MDBX environment.
|
inline |
Returns information about the MDBX transaction.
Return information about the MDBX environment accordingly to the specified transaction.
|
inline |
Returns statistics for a table.
|
inline |
Returns current operation mode.
|
inline |
Returns current operation parameters.
|
inline |
Returns current operate options.
|
inline |
Returns current reclaiming options.
|
inline |
Returns snapshot statistics about the MDBX environment.
Return statistics about the MDBX environment accordingly to the specified transaction.
|
inline |
Returns depth (bitmask) information of nested dupsort (multi-value) B+trees for given table.
|
constexprnoexcept |
Returns libmdbx version information.
Returns the hash value of referenced data.
Returns the first "n" bytes of the slice.
n <= size()
|
inline |
Decodes hexadecimal dump from the slice content to returned buffer.
|
inline |
Return the transaction's ID.
|
inline |
|
inline |
Depletes content of slice and make it invalid.
|
inlinenoexcept |
Checks whether the content of the slice is a Base58 dump.
[in] | ignore_spaces | If true function will skips spaces surrounding (before, between and after) a encoded bytes. However, spaces should not break a code group of characters. |
|
inlinenoexcept |
Checks whether the content of the slice is a Base64 dump.
[in] | ignore_spaces | If true function will skips spaces surrounding (before, between and after) a encoded bytes. However, spaces should not break a code group of characters. |
|
inlinenoexcept |
|
inline |
Checks whether the given data is on a dirty page.
|
constexprnoexcept |
|
inlinenoexcept |
Checks whether the content of the slice is a hexadecimal dump.
[in] | ignore_spaces | If 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. |
|
constexprnoexcept |
Returns true for MDBX's errors.
|
noexcept |
|
noexcept |
|
noexcept |
|
constexprnoexcept |
Checks whether the slice data pointer is nullptr.
|
noexcept |
|
noexcept |
|
constexprnoexcept |
|
constexprnoexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
constexprnoexcept |
|
noexcept |
|
noexcept |
Returns the maximal key size in bytes for given environment and keys mode.
|
inlinestatic |
Returns the maximal key size in bytes for given environment and table flags.
|
inlinestatic |
Returns the maximal key size in bytes for specified page size and keys mode.
|
inlinestatic |
Returns the maximal key size in bytes for specified page size and table flags.
|
inlinestaticnoexcept |
Returns the minimal key size in bytes for specified keys mode.
|
inlinestaticnoexcept |
Returns the minimal key size in bytes for specified table flags.
|
noexcept |
|
inline |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inlinestatic |
Returns the maximum opened map handles, aka DBI-handles.
|
inline |
Returns the maximum number of named tables for the environment.
|
inline |
Returns the maximum number of threads/reader slots for the environment.
Returns the middle "n" bytes of the slice.
from + n <= size()
|
inlineprotected |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Opens cursor for specified key-value map handle.
|
inline |
Open existing key-value map.
|
inline |
Open existing key-value map.
|
inline |
Open existing key-value map.
|
inline |
Open existing key-value map.
|
inline |
Open existing key-value map.
|
inline |
Open existing key-value map.
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
LIBMDBX_API::std::ostream & mdbx::operator<< | ( | ::std::ostream & | , |
const env::durability & | |||
) |
LIBMDBX_API::std::ostream & mdbx::operator<< | ( | ::std::ostream & | , |
const env::geometry & | |||
) |
LIBMDBX_API::std::ostream & mdbx::operator<< | ( | ::std::ostream & | , |
const env::geometry::size & | |||
) |
LIBMDBX_API::std::ostream & mdbx::operator<< | ( | ::std::ostream & | , |
const env::mode & | |||
) |
LIBMDBX_API::std::ostream & mdbx::operator<< | ( | ::std::ostream & | , |
const env::operate_options & | |||
) |
LIBMDBX_API::std::ostream & mdbx::operator<< | ( | ::std::ostream & | , |
const env::operate_parameters & | |||
) |
LIBMDBX_API::std::ostream & mdbx::operator<< | ( | ::std::ostream & | , |
const env::reclaiming_options & | |||
) |
LIBMDBX_API::std::ostream & mdbx::operator<< | ( | ::std::ostream & | , |
const env_managed::create_parameters & | |||
) |
LIBMDBX_API::std::ostream & mdbx::operator<< | ( | ::std::ostream & | , |
const error & | |||
) |
LIBMDBX_API::std::ostream & mdbx::operator<< | ( | ::std::ostream & | , |
const MDBX_debug_flags_t & | |||
) |
LIBMDBX_API::std::ostream & mdbx::operator<< | ( | ::std::ostream & | , |
const MDBX_log_level_t & | |||
) |
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 slice & | |||
) |
inline ::std::ostream & mdbx::operator<< | ( | ::std::ostream & | out, |
const buffer< ALLOCATOR, CAPACITY_POLICY > & | it | ||
) |
inline ::std::ostream & mdbx::operator<< | ( | ::std::ostream & | out, |
const MDBX_error_t & | errcode | ||
) |
|
inline |
|
inlinenoexcept |
|
constexprnoexcept |
Returns the nth byte in the referenced data.
n < size()
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
Returns the maximal database page size in bytes.
|
inlinestaticnoexcept |
Returns the minimal database page size in bytes.
|
inlinestatic |
Returns maximal size of key-value pair to fit in a single page for given environment and table flags.
|
inlinestatic |
Returns maximal size of key-value pair to fit in a single page for specified page size and values mode.
|
inlinestatic |
Returns maximal size of key-value pair to fit in a single page for specified size and table flags.
|
inlinestatic |
Returns maximal size of key-value pair to fit in a single page for specified page size and values mode.
|
inlinenoexcept |
|
inlinestaticnoexcept |
|
inline |
Park read-only transaction.
|
inline |
Creates but not start read transaction.
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
Set integers markers (aka "canary") associated with the environment.
|
inline |
|
inlinestaticnoexcept |
|
inline |
Unbind or close all cursors.
Drops the first "n" bytes from this slice.
n <= size()
Drops the last "n" bytes from this slice.
n <= size()
|
inline |
Переименовывает таблицу ключ-значение.
|
inline |
Переименовывает таблицу ключ-значение.
|
inline |
Переименовывает таблицу ключ-значение.
|
inline |
Renew/bind a cursor with a new transaction and previously used key-value map handle.
|
inline |
Renew read-only transaction.
|
inline |
Replaces and returns a value of the key with new one.
|
inline |
Replaces the particular multi-value of the key with a new value.
|
inline |
|
inline |
Reset read-only transaction.
|
inline |
Returns the first "n" bytes of the slice.
std::out_of_range | if n >= size() |
Returns the middle "n" bytes of the slice.
std::out_of_range | if from + n >= size() |
Drops the first "n" bytes from this slice.
std::out_of_range | if n > size() |
Drops the last "n" bytes from this slice.
std::out_of_range | if n > size() |
Returns the last "n" bytes of the slice.
std::out_of_range | if n >= size() |
|
inline |
|
inline |
Reads sequence generator associated with a key-value map (aka table).
|
inline |
Reads and increment sequence generator associated with a key-value map (aka table).
|
inline |
Sets the application context associated with the environment.
|
inline |
Sets the application context associated with the transaction.
|
inline |
Sets the application context associated with the cursor.
Sets the length by specifying the end of the slice data.
|
inline |
Sets the value of a extra runtime options for an environment.
Set all size-related parameters of environment.
|
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:
|
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.
[in] | seconds_16dot16 | The period in 1/65536 of second when a synchronous flush would be made since the last unsteady commit. |
|
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.
[in] | seconds | The period in second when a synchronous flush would be made since the last unsteady commit. |
|
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.
|
inline |
Starts read (read-only) transaction.
|
inline |
Starts write (read-write) transaction.
|
inline |
Starts write (read-write) transaction.
Checks if the data starts with the given prefix.
|
inlinenoexcept |
|
inlinestaticnoexcept |
|
inline |
|
inline |
|
inlinestatic |
|
inlinestatic |
|
inline |
Controls interprocess/shared relative period since the last unsteady commit to force flush the data buffers to disk, if MDBX_SAFE_NOSYNC is used.
|
inline |
Controls interprocess/shared relative period since the last unsteady commit to force flush the data buffers to disk, if MDBX_SAFE_NOSYNC is used.
|
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.
|
inline |
Flush the environment data buffers.
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. Returns the last "n" bytes of the slice.
n <= size()
|
inlinestatic |
|
inline |
|
inlinestatic |
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
Returns the maximal write transaction size (i.e. limit for summary volume of dirty pages) in bytes for specified page size.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Tries to start write (read-write) transaction without blocking.
|
inline |
|
inline |
|
inline |
|
inline |
Returns the cursor's transaction.
|
inline |
Unbind cursor from a transaction.
|
inline |
Resume parked read-only transaction.
restart_if_ousted=true
.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
Returns maximal data size in bytes to fit in a leaf-page or single large/overflow-page for given environment and table flags.
|
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.
|
inlinestatic |
Returns maximal data size in bytes to fit in a leaf-page or single large/overflow-page for specified size and table flags.
|
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.
|
inlinestatic |
Returns the maximal value size in bytes for given environment and table flags.
|
inlinestatic |
Returns the maximal value size in bytes for specified page size and values mode.
|
inlinestatic |
Returns the maximal value size in bytes for specified page size and table flags.
|
inlinestatic |
Returns the maximal value size in bytes for specified page size and values mode.
|
inlinestaticnoexcept |
Returns the minimal values size in bytes for specified table flags.
|
inlinestaticnoexcept |
Returns the minimal values size in bytes for specified values mode.
|
noexcept |