Skip to content

ysankpia/nervusdb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

564 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NervusDB

Rust-native embedded property graph database — SQLite for graphs.

Store nodes, relationships, and properties in a single local file. Query with Cypher. No server, no setup, no dependencies.

CI License: AGPL-3.0

Highlights

  • Embedded — open a path, get a graph database. No daemon, no network.
  • Cypher — openCypher TCK 100% pass rate (3 897 / 3 897 scenarios).
  • Crash-safe — WAL-based storage with single-writer + snapshot-reader transactions.
  • Multi-platform bindings — Rust, Python (PyO3), Node.js (N-API), CLI.
  • Vector search — built-in HNSW index for hybrid graph + vector queries.
  • Cross-binding parity gateexamples-test hard-asserts Rust/Node/Python isomorphic behavior.

Quick Start

Rust

use nervusdb::Db;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let db = Db::open("/tmp/demo")?;
    db.execute("CREATE (n:Person {name: 'Alice'})", None)?;
    let rows = db.query("MATCH (n:Person) RETURN n.name", None)?;
    println!("{} row(s)", rows.len());
    Ok(())
}

Python

pip install maturin
maturin develop -m nervusdb-pyo3/Cargo.toml
import nervusdb

db = nervusdb.open("/tmp/demo-py")
db.execute_write("CREATE (n:Person {name: 'Alice'})")
for row in db.query_stream("MATCH (n:Person) RETURN n.name"):
    print(row)
db.close()

Node.js

cargo build --manifest-path nervusdb-node/Cargo.toml --release
const { Db } = require("./nervusdb-node");

const db = Db.open("/tmp/demo-node");
db.executeWrite("CREATE (n:Person {name: 'Alice'})");
const rows = db.query("MATCH (n:Person) RETURN n.name");
console.log(rows);
db.close();

CLI

cargo run -p nervusdb-cli -- v2 write \
  --db /tmp/demo \
  --cypher "CREATE (a:Person {name: 'Alice'})-[:KNOWS]->(b:Person {name: 'Bob'})"

cargo run -p nervusdb-cli -- v2 query \
  --db /tmp/demo \
  --cypher "MATCH (a)-[:KNOWS]->(b) RETURN a.name, b.name"

Write statements (CREATE, MERGE, DELETE, SET) must use execute_write / executeWrite or a write transaction. Calling query() with a write statement raises an error.

Architecture

nervusdb          — public API crate (Db::open / query / execute)
nervusdb-query    — Cypher parser, planner, executor
nervusdb-storage  — WAL, page store, segments, compaction
nervusdb-api      — GraphStore / GraphSnapshot traits
nervusdb-cli      — command-line interface
nervusdb-pyo3     — Python binding (PyO3)
nervusdb-node     — Node.js binding (N-API)

Storage layout: <path>.ndb (page store) + <path>.wal (redo log). Transaction model: single writer + concurrent snapshot readers.

Test Status

Suite Tests Status
openCypher TCK 3 897 / 3 897 100%
Rust unit + integration 153 all green
Python (PyO3) 138 all green
Node.js (N-API) 109 all green
examples-test parity (Rust + Node + Python) 601 / 601 all green

Documentation

Development

cargo fmt --all -- --check
cargo clippy --workspace --all-targets -- -W warnings
bash scripts/workspace_quick_test.sh
bash scripts/binding_smoke.sh
bash scripts/tests/stability_window_fixture.sh
GITHUB_TOKEN="$(gh auth token)" \
  bash scripts/stability_window.sh --mode strict --date 2026-02-16 \
  --github-repo LuQing-Studio/nervusdb --github-token-env GITHUB_TOKEN

License

AGPL-3.0

About

NervusDB: An embedded, crash-safe graph database (subset of Cypher, powered by Rust)

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors