cuprate_database

Module config

Source
Expand description

Database Env configuration.

This module contains the main Configuration struct for the database Environment, and types related to configuration settings.

The main constructor is the ConfigBuilder.

These configurations are processed at runtime, meaning the Env can/will dynamically adjust its behavior based on these values.

§Example

use cuprate_database::{
    ConcreteEnv, Env,
    config::{ConfigBuilder, SyncMode}
};

let db_dir = tempfile::tempdir()?;

let config = ConfigBuilder::new(db_dir.path().to_path_buf().into())
    // Use the fastest sync mode.
    .sync_mode(SyncMode::Fast)
    // Build into `Config`
    .build();

// Open the database using this configuration.
let env = ConcreteEnv::open(config.clone())?;
// It's using the config we provided.
assert_eq!(env.config(), &config);

Structs§

Enums§

Constants§