Skip to content

Support more conditionally top level tokens#99

Merged
shssoichiro merged 6 commits intoshssoichiro:masterfrom
lu-zero:more-tokens
Sep 12, 2025
Merged

Support more conditionally top level tokens#99
shssoichiro merged 6 commits intoshssoichiro:masterfrom
lu-zero:more-tokens

Conversation

@lu-zero
Copy link
Copy Markdown
Contributor

@lu-zero lu-zero commented Sep 10, 2025

No description provided.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Sep 10, 2025

Codecov Report

❌ Patch coverage is 97.64706% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 99.24%. Comparing base (227688f) to head (de2b2b7).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/tokenizer.rs 97.10% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #99      +/-   ##
==========================================
- Coverage   99.28%   99.24%   -0.05%     
==========================================
  Files           6        6              
  Lines        3489     3558      +69     
  Branches     3489     3558      +69     
==========================================
+ Hits         3464     3531      +67     
- Misses         18       19       +1     
- Partials        7        8       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lu-zero lu-zero changed the title Support USING in DELETE and MERGE Support more conditionally top level tokens Sep 12, 2025
@shssoichiro shssoichiro requested a review from Copilot September 12, 2025 12:18
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 adds support for more conditionally top level tokens by introducing a new alias field to the Token struct and updating the tokenizer to handle more SQL keywords and statements properly. The changes improve SQL formatting by better recognizing and handling contextual keywords like USING, MERGE INTO, and CREATE TABLE variants.

  • Adds an alias field to Token struct for grouping token behavior variants
  • Extends keyword recognition for CREATE TABLE, MERGE INTO, USING, and other SQL constructs
  • Updates token creation logic to handle conditional top-level token behavior
  • Adds test case for DELETE FROM...USING queries

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/tokenizer.rs Adds alias field to Token struct, extends keyword parsing for CREATE/MERGE/USING statements, updates all token creation sites
src/lib.rs Adds test case for DELETE FROM...USING query formatting
src/formatter.rs Updates top-level token formatting logic to handle CREATE tokens specially

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@shssoichiro shssoichiro merged commit d20763c into shssoichiro:master Sep 12, 2025
6 of 8 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.

4 participants