Prisma ORM · Prisma Client queries
Run several operations atomically
All operations succeed together or none are applied.
await prisma.$transaction([
prisma.user.update({ where: { id: 1 }, data: { name: "A" } }),
prisma.post.create({ data: { title: "Hello", authorId: 1 } }),
]);
Official Prisma ORM documentation