Skip to content

Add row-policy DDL and inspection support - #335

Open
sharadgaur wants to merge 1 commit into
AfterShip:masterfrom
sharadgaur:sharad/row-policy-ddl
Open

sharadgaur wants to merge 1 commit into
AfterShip:masterfrom
sharadgaur:sharad/row-policy-ddl

Conversation

@sharadgaur

@sharadgaur sharadgaur commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add parsing, formatting and AST traversal support for row-policy statements:

  • CREATE, ALTER and DROP [ROW] POLICY
  • SHOW CREATE [ROW] POLICY and SHOW [ROW] POLICIES

Handles policy/table bindings, conditions, policy modes, user/role sets, access storage and cluster clauses. Preserves the difference between omitted ALTER clauses and explicit changes such as USING NONE or TO NONE.

Example

CREATE ROW POLICY example_policy ON db.example_table
USING value > 0 TO example_role;

ALTER ROW POLICY example_policy ON db.example_table USING value > 10;
SHOW CREATE ROW POLICY example_policy ON db.example_table;
DROP ROW POLICY IF EXISTS example_policy ON db.example_table;

Compatibility

Adds policy visit methods to ASTVisitor; DefaultASTVisitor provides their default implementations.

Supports SELECT policy syntax. Parsing does not execute policies or provide access-control enforcement. Also fixes numeric tuple-access token separation found during roundtrip testing.

Tests

Includes AST and formatting fixtures, roundtrip tests, traversal checks, malformed-input coverage and fuzz regressions. Validated with the unit, race and compatibility suites, native ClickHouse formatter comparisons and bounded fuzzing.

@sharadgaur
sharadgaur force-pushed the sharad/row-policy-ddl branch from 7e9749b to 9720786 Compare October 23, 2026 19:12
@git-hulk
git-hulk self-requested a review October 24, 2026 01:27
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