Skip to main content

One post tagged with "Prisma"

View All Tags

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

· 4 min read
James Pang
Product originator

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,