跳到主要内容

1 篇博文 含有标签「Prisma」

查看所有标签

🔧 Nestjs + Prisma, transaction propagation & test rollback & multi-tenancy

· 阅读需 4 分钟
James Pang
Project Initiator

Prisma interactive transaction

Prisma is great. Yet it's support for interactive transaction is currently limited (Up to v5+),

// interactive transaction
prisma.$transaction([array_of_operations,]);

prisma.$transaction(async (tx) => {
// dependent operations
});

Container managed transactions

As we integrate Prisma to NestJs, we want cross Services transaction propagation, container managed tx is even better. After some investigation, we come to @nestjs-cls/transactional,