import { DataConnection } from './DataConnection'; import { DataSource } from './DataSource'; /** * Per-source transactional connection registry for the current async context. * * When a transaction is opened with `DataSource.transaction()` / `DB.transaction()`, * the connection that holds the open transaction is stored here, keyed by the * data source it belongs to. Every entity / query operation that runs inside the * transaction callback (and any async work it awaits) looks the connection up and * routes its statements through it, so a whole unit of work shares a single * connection and commits or rolls back atomically. * * The store is keyed by `DataSource` so that simultaneous transactions on * different sources do not interfere with each other. */ export type TransactionStore = Map; /** The transaction store active in the current async context, if any. */ export declare function getTransactionStore(): TransactionStore | undefined; /** Runs `callback` within the given transaction store scope. */ export declare function runWithTransactionStore(store: TransactionStore, callback: () => Promise): Promise;