TypeScript client for RFDB graph database
npm install @grafema/rfdb-client> TypeScript client for RFDB graph database
Warning: This package is in early alpha stage and is not recommended for production use.
``bash`
npm install @grafema/rfdb-client
High-performance TypeScript client for RFDB (ReginaFlow Database) - a graph database optimized for code analysis. Communicates with RFDB server via Unix socket using MessagePack protocol.
- Socket-based client for out-of-process communication
- MessagePack binary protocol for efficiency
- Full graph operations: nodes, edges, queries
- Datalog query support
`typescript
import { RFDBClient } from '@grafema/rfdb-client';
const client = new RFDBClient('/tmp/rfdb.sock');
await client.connect();
// Add nodes
await client.addNode({
id: 'func-1',
nodeType: 'FUNCTION',
name: 'getUserById',
file: 'src/api/users.ts'
});
// Query nodes
const functions = await client.findByType('FUNCTION');
// Execute Datalog query
const results = await client.queryDatalog('node(X, "FUNCTION"), attr(X, "name", "getUserById")');
await client.close();
`
- connect() - Connect to RFDB serverclose()
- - Close connection
- addNode(node) - Add a single nodeaddNodes(nodes)
- - Batch add nodesgetNode(id)
- - Get node by IDfindByType(type)
- - Find nodes by typequeryNodes(query)
- - Query nodes with filters
- addEdge(edge) - Add a single edgeaddEdges(edges)
- - Batch add edgesgetOutgoingEdges(nodeId, types?)
- - Get outgoing edgesgetIncomingEdges(nodeId, types?)
- - Get incoming edges
- queryDatalog(query)` - Execute Datalog query
Apache-2.0