Correctly format array type specifier#91
Merged
shssoichiro merged 3 commits intoshssoichiro:masterfrom Aug 20, 2025
Merged
Conversation
66fa33d to
782252f
Compare
355e363 to
0048964
Compare
0048964 to
ff153e4
Compare
0885d91 to
9a29ab5
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR refactors SQL type specifier handling by replacing the specific DoubleColon token type with a more generic TypeSpecifier type that can handle both :: and [] syntax. The change addresses SQL Server's use of [ as a string delimiter by properly recognizing array type specifiers in different SQL dialects.
- Replaces
DoubleColontoken type withTypeSpecifierto handle both::and[]syntax - Implements context-aware parsing that only recognizes type specifiers after valid tokens
- Updates minimum Rust version from 1.65 to 1.84 and uses newer Rust APIs
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/tokenizer.rs | Replaces DoubleColon with TypeSpecifier token and adds context-aware parsing logic |
| src/formatter.rs | Updates formatter to handle new TypeSpecifier token type and modernizes API usage |
| src/params.rs | Minor modernization using is_some_and method |
| src/lib.rs | Adds test case for type specifier formatting |
| Cargo.toml | Updates minimum Rust version to 1.84 |
| .github/workflows/sqlformat.yml | Updates CI configuration for new Rust version |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
shssoichiro
approved these changes
Aug 20, 2025
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.
I hate that SQL Server has
[as string delimiter.