NEDB Docs / Running it / Clients & Adapters

One Rust engine, five ways in. Everything below speaks the same NQL and returns the same provenance metadata — pick by embedding model, not by feature set.

Embedded cores (no server)

# Python — pure-Python core, native Rust wheel when available
from nedb import NEDB
db = NEDB("./mydata")          # or NEDB() for in-memory
// Node — napi-rs prebuilt binaries
import { NedbCore } from "nedb-engine";
const db = new NedbCore();     // or NedbCore.open("./data") for durable

Platform coverage: Linux x86_64 + aarch64 (glibc and musl), macOS arm64 + x86_64, Windows x86_64. On Python, platforms without a native wheel fall back to the universal pure-Python wheel — correct, slower, no embedded DAG. On Node there is no fallback.

The HTTP client

nedb.client.NedbClient (Python) and nedb-engine-client (npm) speak the full daemon surface: queries, atomic CAS transactions (if_seq — the primitive that replaces Redis Lua scripts), TTL, indexes, relations, Merkle proofs. A CAS miss raises the same PreconditionFailed shape the embedded engine raises, so code ports without changing except-clauses.

proof = c.proof(c.log(limit=1)[0]["hash"])
from nedb import verify_proof
verify_proof(proof)   # → True, locally — integrity without trusting the server

The wrap family — audit what you already run

One line adds tamper-evident provenance alongside an existing database, no rip-and-replace. Coverage is opt-out (three tables registered out of twelve looks exactly like a complete audit trail until the day you need it), and exclude_columns exists because NEDB cannot forget — that is the product, and it is exactly wrong for a secret.

wrapperhostshadowing
wrap_redisredis.Redisautomatic — every write command
wrap_sqlitesqlite3.Connectionautomatic — execute/executemany
wrap_postgresqlDB-API 2.0 (psycopg2/3)automatic — every cursor write
wrap_mysqlDB-API 2.0explicit shadow_row()
wrap_mongopymongoexplicit shadow_row()

The limit, stated plainly: interception sees writes made through this connection. Cron jobs, psql sessions and other services do not pass through — for whole-database coverage the right mechanism is Postgres logical replication, which is not implemented yet and is not pretended. Unmirrored writes land in nedb.unmirrored_tables rather than vanishing.

Backends: backend="auto" selects nedbd over HTTP, the embedded DAG, or the v1 AOF engine as universal fallback — and auto never picks an engine less durable than the call site had.

Isolation guarantee: NEDB never writes into the host database's namespace. Shadow data lives only in the NEDB engine (Redis: the nedb:{db}:oplog|snapshot|meta keys, nothing else).