verification walkthrough · nedb-engine v9.0.0

Clone it. Install it. Prove it.

A complete walkthrough for evaluating nedb-engine — from git clone to live-registry installs to real tests and benchmarks you ran yourself. Every command below is the same one the repo's own CI runs. Nothing here asks you to trust a claim.

← NEDB Docs  ·  Source →
Time ~15 min Needs Python 3.9+ · Node 18+ · Rust stable · git Works on Linux · macOS · Windows (WSL or native)
  1. Clone the source

    The canonical repo — engine, Rust core, the test suites, the benchmark scripts, the vendored PostgreSQL grammar.

    terminal
    $ git clone https://github.com/aiassistsecure/nedb
    $ cd nedb
    $ git log --oneline -1
    # you are on the same master the releases ship from
    Verify it's real: 500+ commits, 170+ version tags, and every release tag ever cut is in git tag — the release history is the audit trail.
  2. Install from the live registries — the products, not the checkout

    Evaluate what users get. Three registries, same version, same tag — the tri-distribution discipline.

    PyPI

    pip install nedb-engine

    npm

    npm install nedb-engine

    crates.io

    cargo add nedb-engine

    terminal — python side
    $ python3 -m venv venv && source venv/bin/activate
    $ pip install nedb-engine
    $ python3 -c "import nedb; print(nedb.__version__)"
    9.0.0
    $ which nesql nedbd        # the CLI + daemon binaries ride along
    terminal — node side
    $ mkdir nedb-node-demo && cd nedb-node-demo && npm init -y
    $ npm install nedb-engine
    $ node -e "const {NedbCore}=require('nedb-engine'); console.log('loaded ok')"
    What proves what: if the install worked, the version printed matches the latest git tag, and the nesql CLI binary is on your PATH — the same compiled Rust binary the engine's release train stages into every wheel and tarball.
  3. Run the real engine — write, query, time-travel, verify

    60 seconds of actual usage: every core claim of the README, executed by you.

    terminal — python
    $ python3 <<'EOF'
    from nedb import NEDB
    
    db = NEDB("./mydata")          # durable, hash-chained
    db.put("users", "alice", {"name": "Ann", "age": 31})
    
    snap = db.seq                                   # time travel marker
    db.put("users", "alice", {"name": "Ann", "age": 32})
    print(db.get("users", "alice", as_of=snap)["age"])   # → 31 — the past is reachable
    
    db.put("inputs", "m1", {"text": "prefers dark mode"})
    seq = db.seq
    db.put("beliefs", "b1", {"v": 1}, caused_by=[seq])  # causal edge
    print(db.query('FROM beliefs WHERE _id = "b1" TRACE caused_by'))
    print("verify:", db.verify())                      # → True — chain intact
    EOF
    terminal — node
    $ node -e "
    const { NedbCore } = require('nedb-engine');
    const db = new NedbCore();
    db.put('users','bob', JSON.stringify({age:24}));
    console.log('rows:', db.query('FROM users WHERE age > 20').length);  // 1
    console.log('verify:', db.verify());                                 // true
    "
    The one that matters: db.verify(). Flip a byte in ./mydata with a hex editor and run it again — the verdict flips to False. Tamper evidence you can break on purpose.
  4. Run the nesql CLI — plain SQL, both dialects

    The same store, spoken to in PostgreSQL SQL and the FROM-form — routed structurally, no flags.

    terminal
    $ nesql --db ./mydata query "SELECT name, age FROM users ORDER BY age DESC"
    {"name":"Ann","age":32}
    (1 rows)
    
    $ nesql --db ./mydata query "FROM users WHERE age > 30"
    {...}
    (1 rows, 1 scanned)
    
    $ nesql --db ./mydata version
    nesql    9.0.0  ·  engine 9.0.0  ·  grammar_v1 (digest)
    Exit codes are the contract: 0 success · 1 failure · 2 usage · 3 could-not-determine · 4 not found · 5 unsupported. Try nesql --db ./mydata get nosuch coll and check echo $?.
  5. Run the real test suites

    The repo's own gates. These are the suites CI runs on every push — now you run them too.

    terminal — python suites (from the clone)
    $ cd nedb
    $ python3 tests/test_nedb.py              # engine core
    11/11 passed
    $ python3 tests/test_bitemporal.py        # both time axes
    28/28 passed
    $ python3 tests/test_nql_predicates.py    # cross-engine parity
    257 passed
    $ python3 tests/test_nql_shaping.py
    157 passed
    $ python3 tests/test_wallclock_as_of.py   # AS OF by datetime
    25/25 passed
    terminal — rust core (needs the Rust toolchain)
    $ cd rust
    $ cargo test -p nedb-engine --lib
    639 passed
    $ cargo test -p nedb-engine --tests      # integration, real subprocesses
    all targets green
    Cross-engine parity is the point: test_nql_predicates and test_nql_shaping run the same battery through the Python reference and the Rust core and assert identical answers — the guarantee that the two engines cannot quietly disagree.
  6. Run the benchmarks — your machine, your numbers

    Every published number in the repo names its machine and command. Produce your own.

    terminal — embedded core
    $ python3 bench/benchmarks.py --save
    # PUT ~63K/s · GET ~1.3M/s · AS OF (time-travel) reads ~940K/s
    # your absolute numbers will differ; the RATIOS are the claim:
    # time-travel reads cost ~30%, not 10x
    terminal — the daemon over HTTP
    $ NEDBD_DAG=1 nedbd --data /tmp/perf &
    $ python3 tests/test_dag_perf.py --n 10000 --reads 100000
    # sequential writes · point reads · batch · tamper-verify throughput
    terminal — indexed range scans
    $ python3 scripts/bench_index_range.py
    # point lookup 137ms → 0.01ms · BETWEEN 1% 186ms → 1.1ms
    Honest numbers policy: absolute figures are machine-specific and dated in the repo (bench/RESULTS.md, docs/BENCH-sqlselect.md). If your numbers diverge wildly from the published ratios, that's a finding — file it.
  7. The full gate — daemon, wire protocols, tamper

    The complete CI surface: daemon HTTP, PostgreSQL wire, RESP2, encryption, crash boundaries.

    terminal — the daemon, end to end
    $ NEDBD_DAG=1 nedbd --data ./nedb-data &      # v2 DAG engine
    $ curl http://127.0.0.1:7070/health
    {"ok":true,"version":"9.0.0","engine":"dag",...}
    $ curl -X POST http://127.0.0.1:7070/v1/databases/shop/query \\
        -H 'Content-Type: application/json' \\
        -d '{"nql":"SELECT 1"}'                   # SQL over HTTP
    $ NEDBD_RESP2_PORT=6380 nedbd --data ./nedb-data &   # + redis-cli compat
    $ redis-cli -p 6380 EVAL 'FROM orders LIMIT 5' 0
    $ python3 tests/test_pgwire.py               # real psql/libpq client
    • Source cloned — release history auditable via git tags
    • Installed from all three registries — one version on one tag
    • Core semantics proven — time travel, provenance, verify
    • Both SQL dialects through the CLI — exit codes as contract
    • Test suites green on your machine — parity included
    • Benchmarks run by you — ratios match the claims
    • Daemon + wire protocols exercised — the full CI surface