Package Exports
- cypherlite
- cypherlite/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cypherlite) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
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