Skip to content

buildRoleGuardedStatement

buildRoleGuardedStatement(roleName, statementSql): string

Defined in: packages/contracts/src/sql-role-guard.ts:23

Wrap one already-rendered SQL statement (no trailing semicolon) in the role-existence guard.

statementSql is embedded as a PL/pgSQL string literal, so it is escaped as a whole — callers pass ordinary SQL with real single quotes and real double-quoted identifiers.

string

string

string