/** * Database Client * * Lazy-initialized Turso/libSQL client. * Returns null when not configured — all callers handle this gracefully. * * `@libsql/client` is an *optional* peer dependency, so it is imported at * initialization time rather than at module load: a top-level value import * here would make `import "@diegoaltoworks/talker"` throw for a host that * installed only hono (see src/peer-deps.test.ts, which enforces this across * the source tree). A host that configures a database URL but never installed * the driver gets an actionable error naming the package. */ import type { Client } from "@libsql/client"; /** * Initialize the database client from config. * Called once during setup; subsequent calls to getDbClient() return the cached client. * * Throws when `@libsql/client` is not installed — a configured database with * no driver is a deployment mistake, not a runtime condition to degrade past. * Other connection failures keep the historical behavior: logged, client stays * null, callers carry on without persistence. */ export declare function initDbClient(url: string, authToken: string): Promise; /** * Set the database client directly (for testing with mock/in-memory clients). */ export declare function setDbClient(mockClient: Client | null): void; /** * Get the database client. Returns null if not configured. */ export declare function getDbClient(): Client | null; /** * Close the database client. */ export declare function closeDbClient(): Promise;