@mikro-orm/core
Version:
TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.
20 lines (19 loc) • 679 B
TypeScript
import type { EntityManager } from '../EntityManager';
export declare class TransactionContext {
readonly em: EntityManager;
private static storage;
readonly id: number;
constructor(em: EntityManager);
/**
* Creates new TransactionContext instance and runs the code inside its domain.
*/
static create<T>(em: EntityManager, next: (...args: any[]) => T): T;
/**
* Returns current TransactionContext (if available).
*/
static currentTransactionContext(): TransactionContext | undefined;
/**
* Returns current EntityManager (if available).
*/
static getEntityManager(name?: string): EntityManager | undefined;
}