Support more conditionally top level tokens#99
Support more conditionally top level tokens#99shssoichiro merged 6 commits intoshssoichiro:masterfrom
Conversation
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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
aliasfield toTokenstruct 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.
1622803 to
de2b2b7
Compare
No description provided.