NuDB Logo

PrevUpHomeNext

store

A key/value database.

Synopsis
using store = basic_store< xxhasher, native_file >;

store::store

nudb::basic_store

nudb__basic_store

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)

set_burst

Set the burst size.

~basic_store

Destroy the database.

To create a database first call the create free function. Then construct a basic_store and call basic_store::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

Type

Description

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.

Description

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.

Header

#include <nudb/store.hpp>


PrevUpHomeNext