nedb_engine/lib.rs
1// SPDX-FileCopyrightText: 2026 INTERCHAINED LLC
2// SPDX-License-Identifier: BUSL-1.1
3// NEDB · © 2026 INTERCHAINED LLC × Eth-Interchained × Vex (Claude Opus 5)
4
5//! NEDB v2 — Content-addressed DAG storage engine.
6//!
7//! Architecture:
8//!
9//! objects/ — content-addressed, encrypted, BLAKE2b-verified nodes (immutable)
10//! indexes/ — id index (file-per-doc) + sorted indexes (BTreeMap, in-memory)
11//! graph/ — typed DAG edges (filesystem entries)
12//! MANIFEST — BLAKE2b Merkle root of all collection HEADs
13//!
14//! Properties:
15//! - Uncorruptable: atomic writes (tmp→rename), hash verification on read
16//! - Parallel: no global lock on writes; each doc has its own index file
17//! - Instant cold start: no AOF replay; rebuild sorted indexes in parallel
18//! - Self-healing: migrate.rs handles v1→v2 on first startup
19//! - Tamper-evident: BLAKE2b chain from MANIFEST → collection heads → nodes
20
21pub mod store;
22pub mod segment;
23pub mod index;
24pub mod graph;
25pub mod namespace;
26pub mod root;
27pub mod diff;
28pub mod refs;
29pub mod constitution;
30pub mod cause;
31pub mod branch;
32pub mod merge;
33pub mod conflict;
34pub mod migrate;
35pub mod db;
36pub mod exit;
37pub mod nql;
38pub mod pgwire;
39pub mod pgcatalog;
40pub mod sqlselect;
41pub mod sqljoin;
42pub mod sqlplan;
43pub mod sqlpush;
44#[cfg(feature = "cast")]
45pub mod cast;
46pub mod server;
47
48pub use store::{Dek, Node, ObjectStore};
49pub use index::{IdIndex, OrderedValue, SortedIndexes};
50pub use graph::GraphStore;
51pub use db::Db;