/** * DuckDB-backed adapter for the temporal storage interface. * * This class implements {@link ITemporalStore} only. The graph tier is * served by `GraphDbStore` (`@ladybugdb/core`); the temporal tier owns * cochange statistics, structured symbol summaries, and the * `codehub query --sql` escape hatch. * * Lifecycle: `open` → `createSchema` → `bulkLoadCochanges` / * `bulkLoadSymbolSummaries` → `lookupCochangesForFile` / * `lookupSymbolSummary` / `exec` → `close`. * * Timeouts on `exec` are enforced by a JS-side interrupt timer rather * than a DuckDB SQL setting — DuckDB does not expose a per-statement * timeout. */ import type { CochangeLookupOptions, CochangeRow, EmbeddingRow, ITemporalStore, SqlParam, SymbolSummaryRow } from "./interface.js"; export interface DuckDbStoreOptions { readonly readOnly?: boolean; /** * Retained for API symmetry with the prior multi-tier adapter; the * temporal-only adapter never reads embeddings, so the value is ignored. */ readonly embeddingDim?: number; /** Default query timeout for `exec()` calls in ms. Default 5000. */ readonly timeoutMs?: number; } /** * Concrete adapter that satisfies {@link ITemporalStore} over a single * DuckDB connection. Pairs with `GraphDbStore` for the graph tier via * `openStore`. */ export declare class DuckDbStore implements ITemporalStore { private readonly path; private readonly readOnly; private readonly defaultTimeoutMs; private instance; private conn; constructor(path: string, opts?: DuckDbStoreOptions); open(): Promise; close(): Promise; createSchema(): Promise; bulkLoadCochanges(rows: readonly CochangeRow[]): Promise; lookupCochangesForFile(file: string, opts?: CochangeLookupOptions): Promise; lookupCochangesBetween(fileA: string, fileB: string): Promise; bulkLoadSymbolSummaries(rows: readonly SymbolSummaryRow[]): Promise; lookupSymbolSummary(nodeId: string, contentHash: string, promptVersion: string): Promise; lookupSymbolSummariesByNode(nodeIds: readonly string[]): Promise; countSymbolSummaries(): Promise; exec(sql: string, params?: readonly SqlParam[], opts?: { readonly timeoutMs?: number; }): Promise[]>; exportEmbeddingsToParquet(rows: AsyncIterable, absOutPath: string): Promise<{ readonly rowCount: number; readonly duckdbVersion: string; }>; /** * Resolve the live DuckDB engine version via `SELECT version()`. The * result is the string DuckDB embeds in the parquet `created_by` * metadata, so the pack manifest's `pins.duckdbVersion` stays bound to * the writer version that produced the sidecar. */ private fetchDuckdbVersion; healthCheck(): Promise<{ ok: boolean; message?: string; }>; private requireConn; /** * Interrupt the current statement if it exceeds the timeout. DuckDB has no * SQL-level statement timeout, so we schedule a JS timer that calls * `connection.interrupt()` and let the prepared statement throw. */ private withTimeout; } /** * Classify a SPDX-ish license string into one of the five * license-tier buckets. Used by graph-side `listDependencies` finders; * kept here as a free helper for cross-adapter symmetry. */ export declare function classifyLicenseTier(license: string | undefined): "permissive" | "weak-copyleft" | "strong-copyleft" | "proprietary" | "unknown"; //# sourceMappingURL=duckdb-adapter.d.ts.map