-
-
Notifications
You must be signed in to change notification settings - Fork 729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TSQL: Remove dependency on ANSI keyword lists #2170
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2170 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 148 148
Lines 10796 10798 +2
=========================================
+ Hits 10796 10798 +2
Continue to review full report at Codecov.
|
…TSQL_remove_ANSI_keywords
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jpers36 looks great, couple points to clear up 👍
@tsql_dialect.segment(replace=True) | ||
class DescribeStatementSegment(BaseSegment): | ||
"""A `Describe` statement. | ||
|
||
Not present in T-SQL. | ||
""" | ||
|
||
type = "describe_statement" | ||
match_grammar = Nothing() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jpy-git thanks for the syntax help! I moved a couple more stubs to this design now that I know how.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jpers36 really great stuff, thanks for driving the T-SQL syntax coverage forwards 💪 LTGM 🚀 ⭐
Up to this point, the TSQL dialect has incorporated the ANSI dialect's keyword list into its own keyword list. The upside of this has been the ability to rely on ANSI's definitions even when those definitions include references to keywords not existent in TSQL. The downside is that some non-keywords may flag as keywords when parsing TSQL.
This PR aims to rip off the bandage. This is driven by an issue where I have a stored procedure that can't parse because the parser incorrectly flags ROWS as a reserved keyword. So this PR clears the dialect keyword list before applying TSQL's list, and incorporates all changes needed to make that work.
TSQL keyword changes:
TSQL dialect changes:
Test cases: