Crate reth_db

Source
Expand description

MDBX implementation for reth’s database abstraction layer.

This crate is an implementation of [reth-db-api] for MDBX, as well as a few other common database types.

§Overview

An overview of the current data model of reth can be found in the tables module.

Re-exports§

pub use mdbx::create_db;mdbx
pub use mdbx::init_db;mdbx
pub use mdbx::open_db;mdbx
pub use mdbx::open_db_read_only;mdbx
pub use mdbx::DatabaseEnv;mdbx
pub use mdbx::DatabaseEnvKind;mdbx
pub use tables::*;

Modules§

common
Common types used throughout the abstraction.
cursor
Cursor database traits.
database
Database traits.
database_metrics
Database metrics trait extensions.
lockfile
Storage lock utils.
mdbxmdbx
Bindings for MDBX.
mock
Mock database
models
Implements data structures specific to the database
static_file
reth’s static file database table import and access
table
Table traits
tables
Tables and data models.
test_utilstest-utils
Collection of database test utilities
transaction
Transaction database traits.
version
Database version utils.

Macros§

add_static_file_mask
Add mask to select N column values from a specific static file segment row.
impl_fixed_arbitrary
Implements the Arbitrary trait for types with fixed array types.
tables
Defines all the tables in the database.
tables_to_generic
Maps a run-time Tables enum value to its corresponding compile-time Table type.

Structs§

ClientVersion
Client version that accessed the database.

Enums§

DatabaseError
Database error type.
DatabaseWriteOperation
Database write operation type.

Traits§

Database
Main Database trait that can open read-only and read-write transactions.
DbTxUnwindExt
Extension trait for DbTxMut that provides unwind functionality.

Functions§

is_database_emptymdbx
Check if a db is empty. It does not provide any information on the validity of the data in it. We consider a database as non empty when it’s a non empty directory.