import type { LibSQLDatabase } from 'drizzle-orm/libsql'; import type { PgDatabase, PgQueryResultHKT, PgTable } from 'drizzle-orm/pg-core'; import type { DatabaseAdapter, DatabaseConnection, DatabaseConnectionResult } from './database/adapter.js'; import type { Dialect } from './dialect.js'; export type Driver = 'libsql' | 'pglite' | 'bun-sql' | 'postgres-js'; /** Per-dialect public db type, computed from the schema's table brands. */ export type DbFor> = [ Extract ] extends [never] ? LibSQLDatabase : PgDatabase; /** The database an application receives on `context.db` and `app.db`. */ export type BunderstackDb> = DbFor; /** * The transaction handle inside `db.transaction(...)`. Drizzle publishes no * single transaction type for both dialects, so this reads the callback * parameter of the resolved database type. */ export type BunderstackTx> = Parameters['transaction']>[0]>[0]; export declare function validateDatabaseUrl(url: string, dialect: Dialect): void; export declare function createDb>(schema: TSchema, cfg: DatabaseConnection & { adapter: DatabaseAdapter; dialect: Dialect; introspect?: boolean; }): Promise & { driver: Driver; }>; //# sourceMappingURL=db.d.ts.map