RlsPredicateTranspiler
Transpiles LQL row-level security predicates to platform-specific SQL.
Handles the current_user_id() built-in by per-platform substitution
(Postgres: current_setting, SQLite: __rls_context lookup,
SQL Server: SESSION_CONTEXT) and delegates exists(pipeline)
subquery wrappers to the LQL pipeline transpiler.
public static class RlsPredicateTranspiler
Methods
Translate(string, RlsPlatform, string)
public static Result<string, MigrationError> Translate(string lql, RlsPlatform platform, string policyName)
Translate an LQL predicate to platform-specific SQL.
Parameters:
| Name | Type | Description |
|---|---|---|
lql |
String |
LQL predicate. Either a simple expression like |
OwnerId = current_user_id() or an exists(pipeline)
wrapper containing a pipeline. |
| platform | RlsPlatform | Target platform. |
| policyName | String | Policy name -- used for error messages. |
Returns: MigrationError>
CurrentUserIdExpression(RlsPlatform)
public static string CurrentUserIdExpression(RlsPlatform platform)
Returns the platform-specific expression that yields the current user identifier.
Parameters:
| Name | Type | Description |
|---|---|---|
platform |
RlsPlatform |
Returns: String