Skip to content

File mdbx.h++

FileList > docs > mdbx.h++

Go to the source code of this file

The libmdbx C++ API header file. More...

  • #include <algorithm>
  • #include <cassert>
  • #include <climits>
  • #include <cstring>
  • #include <exception>
  • #include <ostream>
  • #include <sstream>
  • #include <stdexcept>
  • #include <string>
  • #include <type_traits>
  • #include <utility>
  • #include <vector>
  • #include "mdbx.h"

Namespaces

Type Name
namespace mdbx
The libmdbx C++ API namespace.
namespace allocation_aware_details
namespace std
STL namespace.

Classes

Type Name
struct bad_map_id
struct bad_transaction
struct bad_value_size
class buffer <class ALLOCATOR, typename CAPACITY_POLICY>
The chunk of data stored inside the buffer or located outside it.
struct capacity_holder
struct inplace_flag_holder
struct stub_allocated_holder
struct buffer_pair_spec <typename ALLOCATOR, typename CAPACITY_POLICY>
struct buffer_tag
Type tag for delivered buffer template classes.
class cache_entry
Cache entry for the transparent read-your-writes caching, see txn::get_cached() andmdbx_cache_get() .
class cursor
Unmanaged cursor.
struct estimate_result
struct move_result
class cursor_managed
Managed cursor.
struct dangling_map_id
struct db_corrupted
struct db_full
struct db_invalid
struct db_too_large
struct db_unable_extend
struct db_version_mismatch
struct db_wanna_write_for_recovery
struct default_capacity_policy
struct duplicated_lck_file
class env
Unmanaged database environment.
struct geometry
Database geometry for size management.
struct size
Tagged type for output to std::ostream.
struct limits
struct operate_options
Operate options.
struct operate_parameters
Operate parameters.
struct reader_info
Reader information.
struct reclaiming_options
Garbage reclaiming options.
struct sysraminfo
Information about the system RAM, see mdbx_get_sysraminfo() .
class env_managed
Managed database environment.
struct create_parameters
Additional parameters for creating a new database.
class error
Implements error information and throwing corresponding exceptions.
class exception
Base class for all libmdbx's exceptions that correspond to libmdbx errors.
class exception_thunk
Transfers C++ exceptions thru C callbacks.
class fatal
Fatal exception that leads to termination anyway in dangerous unrecoverable cases.
struct from_base58
Base58 decoder which satisfySliceTranscoder concept.
struct from_base64
Base64 decoder which satisfySliceTranscoder concept.
struct from_hex
Hexadecimal decoder which satisfy SliceTranscoder concept.
struct incompatible_operation
struct internal_page_full
struct internal_problem
struct key_exists
struct key_mismatch
struct laggard_reader
struct map_handle
A handle for an individual table (aka key-value space, maps or sub-database) in the environment.
struct info
struct max_maps_reached
struct max_readers_reached
struct multivalue
struct mvcc_retarded
struct no_data
struct not_found
struct operation_not_permitted
struct pair
Combines pair of slices for key and value to represent result of certain operations.
struct pair_result
Combines pair of slices for key and value with boolean flag to represent result of certain operations.
struct permission_denied_or_not_writeable
struct reader_slot_busy
struct remote_media
struct slice
References a data located outside the slice.
struct something_busy
struct thread_mismatch
struct to_base58
Base58 encoder which satisfySliceTranscoder concept.
struct to_base64
Base64 encoder which satisfySliceTranscoder concept.
struct to_hex
Hexadecimal encoder which satisfy SliceTranscoder concept.
struct transaction_full
struct transaction_ousted
struct transaction_overlapping
class txn
Unmanaged database transaction.
class txn_managed
Managed database transaction.
struct value_result
Combines data slice with boolean flag to represent result of certain operations.
struct hash<::mdbx::buffer< ALLOCATOR, CAPACITY_POLICY > > <class ALLOCATOR, typename CAPACITY_POLICY>
struct hash<::mdbx::cursor > <>
struct hash<::mdbx::env > <>
struct hash<::mdbx::map_handle > <>
struct hash<::mdbx::slice > <>
struct hash<::mdbx::txn > <>

Public Types

Type Name
union bin

Macros

Type Name
define MDBX_ASSERT_CXX20_CONCEPT_SATISFIED (CONCEPT, TYPE) static\_assert(CONCEPT&lt;TYPE&gt;)
define MDBX_CONSTEXPR_ASSERT (expr) ((expr) ? void(0) : [] { assert(!#expr); }())
define MDBX_CXX01_CONSTEXPR_ENUM [**MDBX\_CXX01\_CONSTEXPR**](group__api__macros.md#define-mdbx_cxx01_constexpr)
define MDBX_CXX11_CONSTEXPR_ENUM [**MDBX\_CXX11\_CONSTEXPR**](group__api__macros.md#define-mdbx_cxx11_constexpr)
define MDBX_CXX14_CONSTEXPR_ENUM [**MDBX\_CXX14\_CONSTEXPR**](group__api__macros.md#define-mdbx_cxx14_constexpr)
define MDBX_CXX17_CONSTEXPR constexpr
define MDBX_CXX17_CONSTEXPR_ENUM [**MDBX\_CXX17\_CONSTEXPR**](mdbx_8h_09_09.md#define-mdbx_cxx17_constexpr)
define MDBX_CXX17_FALLTHROUGH [[fallthrough]]
define MDBX_CXX20_CONSTEXPR constexpr
define MDBX_CXX20_CONSTEXPR_ENUM [**MDBX\_CXX20\_CONSTEXPR**](mdbx_8h_09_09.md#define-mdbx_cxx20_constexpr)
define MDBX_CXX20_LIKELY [[likely]]
define MDBX_EXTERN_API_TEMPLATE (API_ATTRIBUTES, ...) extern template class API\_ATTRIBUTES \_\_VA\_ARGS\_\_
define MDBX_IF_CONSTEXPR constexpr
define MDBX_INSTALL_API_TEMPLATE (API_ATTRIBUTES, ...) template class \_\_VA\_ARGS\_\_
define MDBX_MSVC_DECLSPEC_EMPTY_BASES /\* nope \*/
define MDBX_NODISCARD [[nodiscard]]
define MDBX_USING_CXX_EXPERIMENTAL_FILESYSTEM 0

Detailed Description

This file is part of the libmdbx amalgamated source code (v0.15.0-40-g9554ed2b at 2026-10-10T22:49:10Z).

libmdbx (aka MDBX) is an extremely fast, compact, powerful, embeddable, transactional key-value store, with Apache 2.0 license. MDBX has a specific set of properties and capabilities, focused on creating unique lightweight solutions with extraordinary performance.

Please visit https://libmdbx.dqdkfa.ru for more information, documentation, C++ API description and links to the origin git repo with the source code. Questions, feedback and suggestions are welcome to the Telegram' group https://t.me/libmdbx, MAX' chat https://max.ru/join/dKckvyuARxp1vRK-wnPur8zYCEkbR3OUOmpPWkWxp78.

Donations are welcome to ETH 0xD104d8f8B2dC312aaD74899F83EBf3EEBDC1EA3A, BTC bc1qzvl9uegf2ea6cwlytnanrscyv8snwsvrc0xfsu, SOL FTCTgbHajoLVZGr8aEFWMzx3NDMyS5wXJgfeMTmJznRi. Всё будет хорошо!

The libmdbx project has been completely relocated to the jurisdiction of the Russian Federation.

Note:

libmdbx is still open and provided with first-class free support.

Copyright:

SPDX-License-Identifier: Apache-2.0

Author:

Леонид Юрьев aka Leonid Yuriev leo@yuriev.ru

Date:

2020-2026

Public Types Documentation

union bin



Macro Definition Documentation

define MDBX_ASSERT_CXX20_CONCEPT_SATISFIED

#define MDBX_ASSERT_CXX20_CONCEPT_SATISFIED (
    CONCEPT,
    TYPE
) `static_assert(CONCEPT<TYPE>)`

define MDBX_CONSTEXPR_ASSERT

#define MDBX_CONSTEXPR_ASSERT (
    expr
) `((expr) ? void(0) : [] { assert(!#expr); }())`

Workaround for old compilers without support assertion inside constexpr functions.


define MDBX_CXX01_CONSTEXPR_ENUM

#define MDBX_CXX01_CONSTEXPR_ENUM `MDBX_CXX01_CONSTEXPR`

define MDBX_CXX11_CONSTEXPR_ENUM

#define MDBX_CXX11_CONSTEXPR_ENUM `MDBX_CXX11_CONSTEXPR`

define MDBX_CXX14_CONSTEXPR_ENUM

#define MDBX_CXX14_CONSTEXPR_ENUM `MDBX_CXX14_CONSTEXPR`

define MDBX_CXX17_CONSTEXPR

#define MDBX_CXX17_CONSTEXPR `constexpr`

Workaround for old compilers without properly support for C++17 constexpr


define MDBX_CXX17_CONSTEXPR_ENUM

#define MDBX_CXX17_CONSTEXPR_ENUM `MDBX_CXX17_CONSTEXPR`

define MDBX_CXX17_FALLTHROUGH

#define MDBX_CXX17_FALLTHROUGH `[[fallthrough]]`

define MDBX_CXX20_CONSTEXPR

#define MDBX_CXX20_CONSTEXPR `constexpr`

Workaround for old compilers without properly support for C++20 constexpr.


define MDBX_CXX20_CONSTEXPR_ENUM

#define MDBX_CXX20_CONSTEXPR_ENUM `MDBX_CXX20_CONSTEXPR`

define MDBX_CXX20_LIKELY

#define MDBX_CXX20_LIKELY `[[likely]]`

define MDBX_EXTERN_API_TEMPLATE

#define MDBX_EXTERN_API_TEMPLATE (
    API_ATTRIBUTES,
    ...
) `extern template class API_ATTRIBUTES __VA_ARGS__`

define MDBX_IF_CONSTEXPR

#define MDBX_IF_CONSTEXPR `constexpr`

Workaround for old compilers without properly support for C++20 if constexpr.


define MDBX_INSTALL_API_TEMPLATE

#define MDBX_INSTALL_API_TEMPLATE (
    API_ATTRIBUTES,
    ...
) `template class __VA_ARGS__`

define MDBX_MSVC_DECLSPEC_EMPTY_BASES

#define MDBX_MSVC_DECLSPEC_EMPTY_BASES `/* nope */`

define MDBX_NODISCARD

#define MDBX_NODISCARD `[[nodiscard]]`

Workaround for old compilers without [[nodiscard]] support


define MDBX_USING_CXX_EXPERIMENTAL_FILESYSTEM

#define MDBX_USING_CXX_EXPERIMENTAL_FILESYSTEM `0`


The documentation for this class was generated from the following file docs/mdbx.h++