Add beautify format for ALTER ROLE and CREATE ROLE SETTINGS#256
Merged
Add beautify format for ALTER ROLE and CREATE ROLE SETTINGS#256
Conversation
Co-authored-by: git-hulk <4987594+git-hulk@users.noreply.github.com>
Co-authored-by: git-hulk <4987594+git-hulk@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add support for beautify format in ALTER ROLE
Add beautify format for ALTER ROLE and CREATE ROLE SETTINGS
Feb 13, 2026
git-hulk
approved these changes
Feb 14, 2026
Pull Request Test Coverage Report for Build 21981225862Details
💛 - Coveralls |
There was a problem hiding this comment.
Pull request overview
This PR fixes ClickHouse SQL beautify formatting for ALTER ROLE and CREATE ROLE statements that include SETTINGS, ensuring settings are rendered on multiple lines (with indentation) in beautify mode while keeping compact formatting unchanged.
Changes:
- Update
AlterRole.FormatSQL()andCreateRole.FormatSQL()toBreak()beforeSETTINGS, indent the settings list, and break between items. - Update
RoleSetting.FormatSQL()to useformatter.Break()between setting components (pairs/modifier) so multi-part settings become multi-line in beautify mode. - Refresh beautify golden fixtures for
alter_role.sqlandcreate_role.sqlto match the new output.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
parser/format.go |
Implements beautify-aware line breaking/indentation for role SETTINGS clauses and multi-part RoleSetting rendering. |
parser/testdata/ddl/format/beautify/create_role.sql |
Updates beautify golden output to reflect multi-line SETTINGS formatting for CREATE ROLE. |
parser/testdata/ddl/format/beautify/alter_role.sql |
Updates beautify golden output to reflect multi-line SETTINGS formatting for ALTER ROLE. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
git-hulk
added a commit
that referenced
this pull request
Feb 14, 2026
--------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: git-hulk <4987594+git-hulk@users.noreply.github.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
ALTER ROLE statements with SETTINGS clauses were not respecting beautify mode, rendering all settings inline instead of multi-line.
Changes
formatter.Break()before SETTINGS keyword and indent each setting clauseformatter.Break()to separate setting components (value, MIN, MAX, modifiers) onto individual linesExample
Before:
After (beautified):
Compact mode output remains unchanged.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.