import type {SQLQuery} from '@databases/sql'; export default interface Driver { /** * How long to wait when aquiring a lock on a connection or transaction. * This can help catch cases where you attempt to query using a connection * from within a transaction associated with that connection. */ readonly acquireLockTimeoutMilliseconds: number; beginTransaction(options: TTransactionOptions | undefined): Promise; commitTransaction(): Promise; rollbackTransaction(err: Error): Promise; createSavepoint(savepointName: string): Promise; releaseSavepoint(savepointName: string): Promise; rollbackToSavepoint(savepointName: string): Promise; executeAndReturnAll(queries: SQLQuery[]): Promise; executeAndReturnLast(queries: SQLQuery[]): Promise; queryStream( query: SQLQuery, options: TQueryStreamOptions | undefined, ): AsyncGenerator; shouldRetryTransactionFailure( options: TTransactionOptions | undefined, err: Error, errorCount: number, ): Promise; canRecycleConnectionAfterError(err: Error): Promise; }