MAI CALL - step 7

This commit is contained in:
2026-05-16 15:50:47 +01:00
parent bfc3fa4faf
commit 0fe6da884d
4 changed files with 346 additions and 5 deletions
+4 -5
View File
@@ -58,11 +58,10 @@ import type { PrismaClient } from '@prisma/client';
* The extension does not re-wrap the inner transactional client. Either:
* - issue all operations through the outer scoped client and use the
* sequential array form: `await db.$transaction([op1, op2])`, OR
* - if you need the interactive form, scope explicitly:
* await prisma.$transaction(async (tx) => {
* const scopedTx = tenantScoped(tx as PrismaClient, tenantId);
* ...
* });
* - if you need the interactive form, inject tenantId manually into
* every where/data clause inside the callback. The transaction
* client does NOT support $extends (it is in ITXClientDenyList),
* so tenantScoped(tx, tenantId) throws at runtime.
*
* 3. Models without tenantId (currently only `Tenant`). These are passed
* through unchanged. Code touching Tenant must take care not to leak