RLS and CLS working

This commit is contained in:
Beto Dealmeida
2025-12-17 17:08:58 -05:00
parent 3554325104
commit 2e7df4614c
3 changed files with 47 additions and 7 deletions

View File

@@ -1536,11 +1536,14 @@ class SQLStatement(BaseSQLStatement[exp.Expression]):
# Without schema: qualifies single-table queries, partial for JOINs.
from sqlglot.optimizer.qualify import qualify
# Only expand stars if schema is provided (from DAR with feature flag enabled)
# to avoid potential errors in other contexts
self._parsed = qualify(
self._parsed,
schema=schema,
dialect=self._dialect,
validate_qualify_columns=False,
expand_stars=bool(schema),
)
transformer = CLSTransformer(rules, self._dialect)