cypherlite
v2.1.0
Published
Lightweight embedded graph database with Cypher query support
Maintainers
Readme
CypherLite
SQLite-like simplicity for graph databases.
CypherLite is a lightweight, embedded, single-file graph database engine written in Rust with Node.js bindings via napi-rs. Zero-config, ACID-compliant, with native Cypher query support.
Installation
npm install cypherlitePre-built native addons are available for:
- Linux (x86_64, aarch64)
- macOS (x86_64, arm64)
- Windows (x86_64)
Quick Start
const { open } = require('cypherlite');
// Open (or create) a database
const db = open('my_graph.cyl');
// Create nodes and relationships
db.execute("CREATE (a:Person {name: 'Alice', age: 30})");
db.execute("CREATE (b:Person {name: 'Bob', age: 25})");
db.execute(`
MATCH (a:Person {name: 'Alice'}), (b:Person {name: 'Bob'})
CREATE (a)-[:KNOWS {since: 2024}]->(b)
`);
// Query the graph
const result = db.execute(
'MATCH (p:Person) RETURN p.name, p.age ORDER BY p.age'
);
for (const row of result) {
console.log(`${row['p.name']}: ${row['p.age']}`);
}
// Parameterized queries
const alice = db.execute(
'MATCH (p:Person) WHERE p.name = $name RETURN p.age',
{ name: 'Alice' }
);
// Transactions
const tx = db.begin();
tx.execute("CREATE (c:Person {name: 'Charlie', age: 35})");
tx.commit();
db.close();Features
- ACID Transactions with Write-Ahead Logging
- Cypher Queries: CREATE, MATCH, SET, DELETE, MERGE, WITH, ORDER BY, LIMIT
- Temporal Queries: AT TIME, BETWEEN TIME for point-in-time lookups
- Subgraph Snapshots: CREATE SNAPSHOT for graph state capture
- Hyperedges: Native N:M relationship support
- Plugin System: Custom scalar functions, triggers, serializers
- Single-file Database: Zero configuration, embedded in your application
Links
License
MIT OR Apache-2.0
