NuDB Logo

PrevUpHomeNext

store

A key/value database.

using store = basic_store< xxhasher, native_file >;
Types

Name

Description

file_type

hash_type

Member Functions

Name

Description

appnum

Return the appnum associated with the database.

basic_store

Default constructor.

Copy constructor (disallowed)

block_size

Return the block size associated with the database.

close

Close the database.

dat_path

Return the path to the data file.

fetch

Fetch a value.

insert

Insert a value.

is_open

Returns true if the database is open.

key_path

Return the path to the key file.

key_size

Return the key size associated with the database.

log_path

Return the path to the log file.

open

Open a database.

operator=

Copy assignment (disallowed)

~basic_store

Destroy the database.

To create a database first call the create free function. Then construct a basic_store and call open on it:

error_code ec;
create<xxhasher>(
    "db.dat", "db.key", "db.log",
        1, make_salt(), 8, 4096, 0.5f, ec);
basic_store<xxhasher, native_file> db;
db.open("db.dat", "db.key", "db.log", ec);
Template Parameters

Hasher

The hash function to use. This type must meet the requirements of Hasher.

File

The type of File object to use. This type must meet the requirements of File.

The Hasher used is is xxhasher, which works very well for almost all cases. The File is native_file which works on Windows and POSIX platforms.

Requirements

Header: nudb/store.hpp


PrevUpHomeNext