UNPKG

@myfunc/prisma-transactional

Version:

Decorator that wraps all prisma queries along the whole call stack to a single transaction.

14 lines (12 loc) 680 B
import { ClsService, ClsServiceManager } from 'nestjs-cls'; export { ClsService, ClsServiceManager }; /** That solution can creates and merge transactions. BE CAREFUL when using it, all queries inside transaction will be isolated and can lead to deadlock. Found here https://github.com/prisma/prisma/issues/5729 */ export declare function PrismaTransactional(isolationLevel?: string): MethodDecorator; export declare namespace PrismaTransactional { var onSuccess: <T>(callback: () => T | Promise<T>) => T | Promise<T> | undefined; var execute: <T>(callback: () => Promise<T>, isolationLevel?: string | undefined) => Promise<T>; var prismaRoot: any; }