export type SqliteDriverName = 'better-sqlite3' | 'node:sqlite'; export interface SqliteStatement { run(...params: unknown[]): { readonly changes: number | bigint; }; get(...params: unknown[]): unknown; all(...params: unknown[]): unknown[]; } /** The part of a SQLite connection Dexto uses, the same on either driver. */ export interface SqliteConnection { readonly driver: SqliteDriverName; exec(sql: string): void; prepare(sql: string): SqliteStatement; /** Wraps `work` in one transaction: committed when it returns, rolled back when it throws. */ transaction(work: () => T): () => T; close(): void; } export interface SqliteOpenOptions { readonly readonly: boolean; /** Refuse to create the file when it is missing. */ readonly fileMustExist: boolean; /** How long to wait on a locked database, in milliseconds. */ readonly timeoutMs: number; } /** Opens `file` with `driver` only; null when that driver does not load on this Node.js. */ export declare function openSqliteWith(driver: SqliteDriverName, file: string, options: SqliteOpenOptions): Promise; /** Opens `file` with better-sqlite3, or with node:sqlite where better-sqlite3 does not load. */ export declare function openSqlite(file: string, options: SqliteOpenOptions): Promise; //# sourceMappingURL=sqlite-driver.d.ts.map