Skip to content

Snowflake: parse masking policy statement family - #14

Open
sabir-akhadov-localstack wants to merge 1 commit into
lav-1220-constraint-propertiesfrom
lav-1362-masking-policy
Open

Snowflake: parse masking policy statement family#14
sabir-akhadov-localstack wants to merge 1 commit into
lav-1220-constraint-propertiesfrom
lav-1362-masking-policy

Conversation

@sabir-akhadov-localstack

Copy link
Copy Markdown
Collaborator

Adds the Snowflake masking-policy statement family, mirroring the existing row-access-policy family (ADR 070 §1, LAV-1362).

Statements

  • CREATE [OR REPLACE] MASKING POLICY [IF NOT EXISTS] <name> AS (<arg> <type>[, …]) RETURNS <type> -> <body> [COMMENT = '…'] (multi-arg conditional-masking signatures included)
  • ALTER MASKING POLICY [IF EXISTS] <name> { SET BODY -> <expr> | RENAME TO <name> | SET COMMENT = '…' | UNSET COMMENT }
  • DROP MASKING POLICY [IF EXISTS] <name>
  • DESC[RIBE] MASKING POLICY <name>
  • SHOW MASKING POLICIES [LIKE '…'] [IN <scope>]
  • ALTER TABLE <t> {MODIFY|ALTER} COLUMN <c> { SET MASKING POLICY <p> [USING (…)] [FORCE] | UNSET MASKING POLICY }
  • The same column op on ALTER VIEW (new Statement::AlterViewColumn)
  • Column-level [WITH] MASKING POLICY <p> [USING (…)] in CREATE VIEW column lists already parses via the shared ColumnPolicy::MaskingPolicy option (verified with a test)

AST

  • New Statement::{CreateMaskingPolicy, AlterMaskingPolicy, DropMaskingPolicy, DescribeMaskingPolicy, ShowMaskingPolicies, AlterViewColumn}
  • New AlterMaskingPolicyOperation enum
  • New AlterColumnOperation::{SetMaskingPolicy, UnsetMaskingPolicy} variants
  • New BODY keyword

Fork-side tests mirror the row-access-policy coverage and round-trip via verified_stmt / one_statement_parses_to.

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant