import { type AliasNode, CompiledQuery, type DatabaseConnection, type DatabaseIntrospector, DefaultQueryCompiler, type Dialect, DialectAdapterBase, type Driver, type Kysely, type QueryCompiler, type QueryResult, type TransactionSettings, } from 'kysely'; /** * Subset of oracledb's Pool interface used by the dialect. * We define our own interface to avoid importing the `oracledb` package directly. */ export interface OraclePool { getConnection(): Promise; close(drainTime?: number): Promise; } /** * Subset of oracledb's Connection interface used by the dialect. */ export interface OraclePoolConnection { execute( sql: string, params: unknown[], options?: Record, ): Promise<{ rows?: R[]; rowsAffected?: number; resultSet?: OracleResultSet; outBinds?: unknown; }>; commit(): Promise; rollback(): Promise; close(): Promise; } interface OracleResultSet { getRow(): Promise; close(): Promise; } declare class OracleQueryCompiler extends DefaultQueryCompiler { protected getLeftIdentifierWrapper(): string; protected getRightIdentifierWrapper(): string; protected visitAlias(node: AliasNode): void; } declare class OracleAdapter extends DialectAdapterBase { #private; get supportsReturning(): boolean; get supportsTransactionalDdl(): boolean; acquireMigrationLock(_: Kysely): Promise; releaseMigrationLock(_: Kysely): Promise; } declare class OracleConnection implements DatabaseConnection { #private; readonly id: number; constructor(connection: OraclePoolConnection, executeOptions?: Record); executeQuery(compiledQuery: CompiledQuery): Promise>; formatQuery(query: CompiledQuery): { sql: string; bindParams: unknown[]; }; streamQuery(compiledQuery: CompiledQuery, _chunkSize?: number): AsyncIterableIterator>; get connection(): OraclePoolConnection; } declare class OracleDriver implements Driver { #private; constructor(config: OracleDialectConfig); init(): Promise; acquireConnection(): Promise; savepoint( connection: OracleConnection, savepointName: string, compileQuery: QueryCompiler['compileQuery'], ): Promise; rollbackToSavepoint( connection: OracleConnection, savepointName: string, compileQuery: QueryCompiler['compileQuery'], ): Promise; releaseSavepoint( connection: OracleConnection, savepointName: string, compileQuery: QueryCompiler['compileQuery'], ): Promise; beginTransaction(connection: OracleConnection, settings: TransactionSettings): Promise; commitTransaction(connection: OracleConnection): Promise; rollbackTransaction(connection: OracleConnection): Promise; releaseConnection(connection: OracleConnection): Promise; destroy(): Promise; } export interface OracleDialectConfig { pool: OraclePool; executeOptions?: Record; } export declare class OracleDialect implements Dialect { #private; constructor(config: OracleDialectConfig); createDriver(): OracleDriver; createAdapter(): OracleAdapter; createIntrospector(db: Kysely): DatabaseIntrospector; createQueryCompiler(): OracleQueryCompiler; } export {};