@open-nodo/core-db
v0.1.1
Published
Tenant-scoping primitives and a shared Prisma kernel for Tenant, OrgUser, Membership, and AuditEntry.
Readme
@open-nodo/core-db
Tenant-scoping primitives and the shared Prisma kernel for Tenant, OrgUser,
Membership, and AuditEntry.
import { assertSameTenant, tenantWhere, withTenant } from "@open-nodo/core-db";
const rows = await prisma.entry.findMany({
where: { ...tenantWhere(ctx), active: true },
});
await prisma.entry.create({ data: withTenant(ctx, { name }) });
assertSameTenant(ctx, row);The package ships primitives plus prisma/kernel.prisma. Hosts compose that
artifact with the accounting schema and enforce tenant context at every read
and write boundary. Schema composition and isolation tests are release criteria
in the root roadmap.
Licensed under AGPL-3.0-or-later.
