-
Notifications
You must be signed in to change notification settings - Fork 765
feat: 1/7 expose PostgreSQL role parser surface #25521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tabVersion
wants to merge
4
commits into
main
Choose a base branch
from
ralph/rbac-split-01-parser-surface
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
5b882a8
Expose PostgreSQL role syntax safely
tabVersion 0d4aceb
Preserve role-name parsing before role-option revoke
tabVersion 6a8bbd3
Preserve role grants for keyword-like role names
tabVersion 69f1521
Lock staged role-option rejection coverage
tabVersion File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| # PostgreSQL-style RBAC parser surface | ||
|
|
||
| This note documents the staged parser and dispatch surface that was added for | ||
| PostgreSQL-style RBAC compatibility work. | ||
|
|
||
| ## Scope | ||
|
|
||
| The SQL parser and frontend statement dispatcher now recognize these statements: | ||
|
|
||
| - `CREATE ROLE` | ||
| - `ALTER ROLE` | ||
| - role-membership `GRANT ... TO ... [WITH ADMIN OPTION]` | ||
| - role-membership `REVOKE [ADMIN OPTION FOR] ... FROM ...` | ||
| - `SET ROLE` | ||
| - `RESET ROLE` | ||
|
|
||
| The parser also accepts the PostgreSQL-style role options currently needed by the | ||
| test matrix for this lane, including: | ||
|
|
||
| - `CREATEDB` / `NOCREATEDB` | ||
| - `CREATEROLE` / `NOCREATEROLE` | ||
| - `INHERIT` / `NOINHERIT` | ||
| - `LOGIN` / `NOLOGIN` | ||
| - legacy RisingWave user aliases that already existed | ||
|
|
||
| ## Current implementation boundary | ||
|
|
||
| This lane intentionally lands parser and dispatcher support before the meta and | ||
| session lanes are finished. | ||
|
|
||
| That means some statements are **accepted and dispatched** but still terminate in | ||
| explicit `not implemented` frontend handlers until the downstream lanes land: | ||
|
|
||
| - membership grant/revoke execution | ||
| - `SET ROLE` | ||
| - `RESET ROLE` | ||
|
|
||
| This staged boundary is deliberate so that: | ||
|
|
||
| 1. parser and AST contracts stabilize early, | ||
| 2. regression tests can be written against a fixed SQL surface, and | ||
| 3. meta/session work can plug into the already-routed statement variants. | ||
|
|
||
| ## Verification coverage | ||
|
|
||
| The worker verification for this lane covers both unit-style parser assertions and | ||
| parser-test YAML contracts: | ||
|
|
||
| - `sqlparser_common` role-focused tests | ||
| - `role.yaml` | ||
| - `drop.yaml` | ||
|
|
||
| These suites are the source of truth for the accepted SQL spellings and formatter | ||
| output of the parser surface described above. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.