UNPKG

@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.

14 lines (13 loc) 735 B
import type { TransactionOptions } from '../enums'; import type { ContextProvider } from '../typings'; type TransactionalOptions<T> = TransactionOptions & { context?: ContextProvider<T>; }; /** * This decorator wraps the method with `em.transactional()`, so you can provide `TransactionOptions` just like with `em.transactional()`. * The difference is that you can specify the context in which the transaction begins by providing `context` option, * and if omitted, the transaction will begin in the current context implicitly. * It works on async functions and can be nested with `em.transactional()`. */ export declare function Transactional<T extends object>(options?: TransactionalOptions<T>): MethodDecorator; export {};