/** * Dual-runtime SQLite driver. * * Detects Bun vs. Node at runtime and dynamically imports the appropriate * sqlite module. NO static imports of `bun:sqlite` or `node:sqlite` — the * whole point is to avoid crashing Node when it encounters a `bun:sqlite` * static-import at module evaluation time. * * Under Bun: uses `bun:sqlite` (Database) * Under Node: uses `node:sqlite` (DatabaseSync / StatementSync) * * The public DatabaseDriver interface matches the subset of methods that * the memory module actually uses (store.ts, search.ts, schema.ts, and * memory-clean.ts). * * @module */ /** Thin abstraction over a single prepared statement. */ export interface StatementDriver { get(...params: unknown[]): unknown | undefined; all(...params: unknown[]): unknown[]; run(...params: unknown[]): void; } /** Thin abstraction over an SQLite database connection. */ export interface DatabaseDriver { exec(sql: string): void; run(sql: string, ...params: unknown[]): void; query(sql: string): StatementDriver; transaction(fn: () => R): () => R; close(): void; } /** * Create a database handle using the runtime-appropriate sqlite driver. * * The `path` should be an absolute filesystem path (the directory must * already exist — callers are responsible for `mkdirSync(dirname(path), * { recursive: true })` beforehand). */ export declare function createDatabase(path: string): Promise; //# sourceMappingURL=db-driver.d.ts.map