/**
 * SQLite connection — runtime-agnostic (bun:sqlite under Bun, better-sqlite3 under Node).
 *
 * Database lives at ~/.jait/data/jait.db (created automatically).
 * For tests, pass ":memory:" as dbPath.
 */
import type { SqliteDatabase, DrizzleDB } from "./sqlite-shim.js";
export type { SqliteDatabase } from "./sqlite-shim.js";
export type JaitDB = DrizzleDB;
/** Resolve the default DB path: ~/.jait/data/jait.db */
export declare function defaultDbPath(): string;
/**
 * Open (or create) the SQLite database and run table creation.
 *
 * @param dbPath  File path for the SQLite DB, or ":memory:" for tests.
 * @returns { db, sqlite } — drizzle instance + raw SQLite handle
 */
export declare function openDatabase(dbPath?: string): Promise<{
    db: JaitDB;
    sqlite: SqliteDatabase;
}>;
/**
 * Run DDL to create all tables if they don't already exist.
 * Uses raw SQL so we don't need drizzle-kit push in production.
 *
 * Migrations are numbered and tracked in a `_migrations` table.
 * Only new (un-applied) migrations run on each startup — safe for updates.
 */
export declare function migrateDatabase(sqlite: SqliteDatabase): void;
/**
 * Post-migration safety net: verify that every column the Drizzle schema
 * expects actually exists in the SQLite table, and add any that are missing.
 *
 * This guards against migrations that silently swallowed errors via try/catch,
 * or against historical migrations being modified in-place after they were
 * already marked as applied.
 */
export declare function verifySchema(sqlite: SqliteDatabase): void;
/**
 * Get the current schema version (highest applied migration ID).
 */
export declare function getSchemaVersion(sqlite: SqliteDatabase): number;
//# sourceMappingURL=connection.d.ts.map