Skip to main content

Crate crypto_database

Crate crypto_database 

Source
Expand description

crypto-database

The verifiable v2/v3 distribution of NEDB: content-addressed Merkle DAG, AS OF time-travel, causal provenance, BLAKE2b tamper-evidence.

Re-exports the full nedb-engine API unchanged. crypto-database’s distribution defaults — the verifiable v3 segment store (content-addressed, self-verifying; AS OF / TRACE time-travel) — are applied by setting the engine’s existing env knobs before a Db is opened: programmatically via apply_distro_defaults, and automatically by the npm main shim and the nedbd-v2 daemon shim. No engine fork, no flags.

Modules§

db
Main DAG database — coordinates ObjectStore, IdIndex, SortedIndexes, GraphStore.
graph
DAG edge store — typed directed edges between node hashes.
index
Index store for NEDB v2.
migrate
Automatic v1 → v2 DAG migration.
nql
NQL (NEDB Query Language) parser and executor for v2 DAG storage.
segment
segment.rs — NEDB v3 packed object substrate.
server
nedbd v2 HTTP server — same /v1/databases/* API surface as v1. Drop-in replacement: Vision, itsl_mirror, all existing clients work unchanged.
store
Content-addressed object store — the foundation of NEDB v2.

Structs§

Db
Dek
Encryption key material (AES-256-GCM). In v1 this was called DEK; the structure is the same.
GraphStore
IdIndex
Per-document ID index — atomic file-per-doc, sharded across 256 subdirs.
Node
A single versioned document node in the DAG.
ObjectStore
Content-addressed, encrypted, tamper-evident object store.
SortedIndexes
In-memory sorted index per (collection, field). Rebuilt from object store on startup. O(log n) ORDER BY queries.

Enums§

OrderedValue
Ordered JSON value for BTree indexes (null < bool < number < string < array < object).

Functions§

apply_distro_defaults
Apply crypto-database’s default engine modes — the verifiable v3 segment store — unless the caller has already chosen. Call once before opening a Db. Set-if-unset: an explicit NEDB_DAG_V3 (including 0) always wins.