/** * Local library DB initialization. * * Opens an `@libsql/client` SQLite connection over a `file:` URL, sets WAL + * FK pragmas, applies the one-shot Libraries migration if the legacy * `sources` table is present, then runs the modern DDL (idempotent via * CREATE TABLE IF NOT EXISTS). `@libsql/client` runs on both Node and Bun * from a single driver — no runtime dispatch. * * @docLink packages/library/concepts#local-library */ import { type LibSQLDatabase } from "drizzle-orm/libsql"; import * as schema from "./schema.js"; export type LibraryDb = LibSQLDatabase; export interface LibraryDbHandle { db: LibraryDb; close(): void; } /** * Open (or create) the local library SQLite database. * * Async because `@libsql/client` is async-only. `LocalIndex` opens the DB * lazily on first use to keep its constructor synchronous. * * @param dbPath - Absolute path to the `index.db` file. Pre-2026-05-27 * `lib.db` paths now hard-fail; see {@link assertNoLegacyLibDb}. * @returns A handle carrying the Drizzle DB and a synchronous `close()`. */ export declare function createLibraryDb(dbPath: string): Promise; //# sourceMappingURL=db.d.ts.map