UNPKG

nestjs-transaction

Version:

A library that extracts and provides only some of the functions of the 'typeorm-transactional' npm module that are needed to operate in the Nestjs + TypeORM environment

30 lines (29 loc) 1.37 kB
/** * Transaction propagation properties */ export declare const Propagation: { /** * Internal transactions participate in running external transactions (default properties) * @description If there is already a transaction being performed in the execution context, participate in that transaction and do not create a new physical transactions. */ readonly REQUIRED: "REQUIRED"; /** * Join if there is an external transaction * @description If external transactions exist, they participate and proceed, and if not, they execute without transactions. */ readonly SUPPORTS: "SUPPORTS"; /** * Execute within a nested transaction if a current transaction exists, behave like REQUIRED else. * @description If there is already a transaction being performed in the execution context, create Typeorm savepoint and execute it as a nested transaction. */ readonly NESTED: "NESTED"; /** * Always create a new transaction and execute it. * @description Create a new transaction and execute it, and if there is already a transaction being performed in the execution context, stop the existing transaction and execute it. */ readonly REQUIRES_NEW: "REQUIRED_NEW"; }; /** * Transaction propagation properties */ export type PropagationType = (typeof Propagation)[keyof typeof Propagation];