Skip to content

Correctly format array type specifier#91

Merged
shssoichiro merged 3 commits intoshssoichiro:masterfrom
lu-zero:type-specifiers
Aug 20, 2025
Merged

Correctly format array type specifier#91
shssoichiro merged 3 commits intoshssoichiro:masterfrom
lu-zero:type-specifiers

Conversation

@lu-zero
Copy link
Copy Markdown
Contributor

@lu-zero lu-zero commented Aug 18, 2025

I hate that SQL Server has [ as string delimiter.

@lu-zero lu-zero force-pushed the type-specifiers branch 4 times, most recently from 66fa33d to 782252f Compare August 18, 2025 10:25
@lu-zero lu-zero force-pushed the type-specifiers branch 2 times, most recently from 355e363 to 0048964 Compare August 18, 2025 13:36
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 DoubleColon token type with TypeSpecifier to 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 shssoichiro merged commit d5424cd into shssoichiro:master Aug 20, 2025
5 checks passed
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.

3 participants