/**
 * Runtime-agnostic SQLite shim.
 *
 * Priority order:
 *   1. `bun:sqlite`      — when running under Bun
 *   2. `node:sqlite`     — Node.js 22.5+ built-in (no native addon needed)
 *   3. `better-sqlite3`  — Node.js fallback (uses prebuild-install)
 *
 * All three backends expose the same subset we need (.exec, .prepare, .close)
 * so the rest of the gateway code never needs to know which engine is active.
 *
 * Drizzle ORM's `better-sqlite3` adapter works with both `better-sqlite3` and
 * `node:sqlite` because `DatabaseSync` is API-compatible (duck-typed).
 */
import * as schema from "./schema.js";
export interface SqliteStatement {
    all(...params: unknown[]): unknown[];
    run(...params: unknown[]): unknown;
    get(...params: unknown[]): unknown;
}
export interface SqliteDatabase {
    exec(sql: string): void;
    prepare(sql: string): SqliteStatement;
    close(): void;
}
/** Which SQLite backend was actually loaded. Useful for diagnostics. */
export declare let sqliteBackend: "bun:sqlite" | "node:sqlite" | "better-sqlite3";
/**
 * Open a raw SQLite database using whichever native driver is available.
 * The returned handle satisfies `SqliteDatabase` in both runtimes.
 */
export declare function openRawSqlite(path: string): Promise<SqliteDatabase>;
type SchemaType = typeof schema;
/**
 * Wrap a raw SQLite handle with the matching Drizzle ORM adapter.
 * Returns a fully-typed Drizzle instance regardless of runtime.
 *
 * For non-Bun runtimes (node:sqlite or better-sqlite3), we bypass
 * `drizzle-orm/better-sqlite3` (whose driver.js top-level-imports
 * the `better-sqlite3` package) and construct the Drizzle instance
 * from safe sub-modules that have no native-addon dependency.
 */
export declare function createDrizzle(rawDb: SqliteDatabase): Promise<DrizzleDB>;
import type { BetterSQLite3Database } from "drizzle-orm/better-sqlite3";
export type DrizzleDB = BetterSQLite3Database<SchemaType>;
export {};
//# sourceMappingURL=sqlite-shim.d.ts.map