import { IDatabaseConnection } from './IDatabaseConnection'; import { IQueryable } from './IQueryable'; import { Application } from './Application'; import { IsolationLevel } from './IsolationLevel'; export type ITransactionExecutor = (connection: IDatabaseConnection) => Promise; /** * A class encapsulating an entire transaction from beginning to commitment. * * This encapsulates a routine to conduct for the transaction. * Should the transaction fail due to a deadlock, the transaction will automatically * be tried. * * NOTE: It is unsafe to run two transactions on the same connection concurrently. * The execution *must* be waited to complete before executing another transaction, * on the same connection. */ export declare class Transaction implements IQueryable { private $retryLimit; private $application; private $isolationLevel; private $executor; constructor(app: Application, executor: ITransactionExecutor, retryLimit?: number, isolationLevel?: IsolationLevel); onPreQuery(connection: IDatabaseConnection): Promise; getQuery(connection: IDatabaseConnection): string; getParametersForQuery(): Record; onPostProcess(connection: IDatabaseConnection, results: any): Promise; execute(connection: IDatabaseConnection): Promise; }