import { DatabaseConnection, Dialect, DialectAdapter, Driver, Kysely, DatabaseIntrospector, QueryCompiler, PostgresDriver, CompiledQuery, QueryResult } from 'kysely'; interface PostgresJSDialectConfig { /** * Called every time a connection is acquired from the pool. */ onReserveConnection?: (connection: DatabaseConnection) => Promise; /** * An instance, or a factory returning an instance, of `postgres`'s `Sql` (returned by `postgres(...)`) or Bun's `SQL` class. */ readonly postgres: PostgresJSSql | (() => PostgresJSSql | Promise); } interface PostgresJSSql { end(): Promise; reserve(): Promise; } interface PostgresJSReservedSql { release(): void; unsafe(query: string, parameters?: any[], queryOptions?: any): PostgresJSPendingQuery; } interface PostgresJSPendingQuery extends Promise & PostgresJSResultQueryMeta> { cursor?: (rows?: number) => AsyncIterable; } interface PostgresJSResultQueryMeta { command: string; count: number; } declare class PostgresJSDialect implements Dialect { #private; constructor(config: PostgresJSDialectConfig); createAdapter(): DialectAdapter; createDriver(): Driver; createIntrospector(db: Kysely): DatabaseIntrospector; createQueryCompiler(): QueryCompiler; } declare const RELEASE_CONNECTION_SYMBOL: unique symbol; declare class PostgresJSDriver extends PostgresDriver { #private; constructor(config: PostgresJSDialectConfig); acquireConnection(): Promise; destroy(): Promise; init(): Promise; releaseConnection(connection: DatabaseConnection): Promise; } declare class PostgresJSConnection implements DatabaseConnection { #private; constructor(reservedConnection: PostgresJSReservedSql); executeQuery(compiledQuery: CompiledQuery): Promise>; streamQuery(compiledQuery: CompiledQuery, chunkSize: number): AsyncIterableIterator>; [RELEASE_CONNECTION_SYMBOL](): void; } declare class PostgresJSDialectError extends Error { constructor(message: string); } export { PostgresJSDialect, type PostgresJSDialectConfig, PostgresJSDialectError, PostgresJSDriver };