Browse modulesTenancyFunctions
Function: applyRlsPolicies()
function applyRlsPolicies<R>(exec: (sql: string) => Promise<R>, config: RlsConfig): Promise<void>;Defined in: server/tenancy/rls.ts:261
Apply the RLS scaffold through a caller-supplied executor (e.g.
(sql) => pool.query(sql) or prisma.$executeRawUnsafe). The scaffold is a
single atomic statement, so this runs exactly one exec call — idempotent,
safe to run in a migration or once per deploy. Must run as a privileged role.
Type Parameters
| Type Parameter |
|---|
R |
Parameters
| Parameter | Type |
|---|---|
exec | (sql: string) => Promise<R> |
config | RlsConfig |
Returns
Promise<void>