aiwg
Version:
Deployment tool and support utility for AI context. Copies agents, skills, commands, rules, and behaviors into the paths each AI platform reads (Claude Code, Codex, Copilot, Cursor, Warp, OpenClaw, and 6 more) so one source of truth works across 10 platfo
52 lines • 1.99 kB
TypeScript
/**
* SQLite Graph Backend
*
* Optional implementation of GraphBackend using better-sqlite3.
* Provides persistent on-disk storage, native SQL set operations
* (INTERSECT/EXCEPT/UNION), recursive CTE traversal, and cross-graph
* federation via ATTACH DATABASE.
*
* Install: npm install better-sqlite3 @types/better-sqlite3
*
* @implements #729
* @source @src/artifacts/graph-backend.ts
* @tests @test/unit/artifacts/sqlite-backend.test.ts
*/
import type { GraphBackend } from '../graph-backend.js';
import type { DependencyGraph } from '../types.js';
/**
* SQLite-backed graph with persistent storage and native SQL operations.
*
* Each graph lives in a `.db` file under `.aiwg/.index/{graphName}/`.
* Uses WAL mode for concurrent read access.
*/
export declare class SqliteGraphBackend implements GraphBackend {
private db;
/**
* Create a new SQLite graph backend.
*
* @param dbPath - Path to the SQLite database file. Use ':memory:' for in-memory.
*/
constructor(dbPath?: string);
private initSchema;
addNode(id: string, attrs?: Record<string, unknown>): void;
addEdge(source: string, target: string, type?: string, attrs?: Record<string, unknown>): void;
hasNode(id: string): boolean;
hasEdge(source: string, target: string, edgeType?: string): boolean;
getNodeAttrs(id: string): Record<string, unknown> | undefined;
nodes(): string[];
neighbors(nodeId: string, direction: 'in' | 'out' | 'both', edgeType?: string): string[];
intersection(setA: string[], setB: string[]): string[];
difference(setA: string[], setB: string[]): string[];
union(setA: string[], setB: string[]): string[];
serialize(): DependencyGraph;
deserialize(data: DependencyGraph): void;
nodeCount(): number;
edgeCount(): number;
/**
* Close the database connection.
* Call this when the backend is no longer needed.
*/
close(): void;
}
//# sourceMappingURL=sqlite-backend.d.ts.map