Kaizen
Browse modulesTenancyFunctions

Function: buildSetConfigSql()

function buildSetConfigSql(binding: TenantBinding | undefined, config: TenantTransactionConfig): string;

Defined in: server/tenancy/client.ts:89

The SQL that pins the RLS GUCs for the current transaction, LOCAL (reset at COMMIT/ROLLBACK, so pool-safe). currentTenantGuc is empty when not a tenant binding — which the policies' current_setting(…, true) maps to NULL, so RLS matches no rows (fail closed). publicReadGuc is 'on' only in public-read mode, enabling the SELECT-only cross-tenant bypass in the policies.

Parameters

ParameterType
bindingTenantBinding | undefined
configTenantTransactionConfig

Returns

string

On this page