Native Row-Level Security
Every database query is strictly scoped by the current tenant context.
1import { withTenant } from '@nebutra/rls'23export const getPosts = withTenant(4 async (ctx) => {5 const data = await prisma.post.findMany({6 where: {7 tenantId: ctx.tenant.id,8 published: true,9 },10 include: { author: true },11 });12 return data;13 }14);
$ npx nebutra rls-audit --strict
✔ 0 cross-tenant leaks detected
14 queries scanned in 0.8s
