You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
In current date and age, most DB engines do not care if any of the tokens are upper or lower case. One could argue that it is a good practice to keep keywords uppercase for readability, but sqlparse should not attempt to be an opinionated linter.
I need to detect "SELECT foo FROM bar INTO baz" statements, which is a quirky replacement for CREATE TABLE AS SELECT in MS SQL Server. I cannot use Token.match for this, however: I would need to explicitly list every single combination of uppercase and lowercase letters in SELECT (Select, select, etc.) if I wanted to use this method. This is 64 possible combinations. Not doing this.
Describe the solution you'd like
An additional parameter (can still default to existing behavior) to allow case ignore when matching Keyword tokens.
Describe alternatives you've considered
Monkey patching my own function
Ok, so after reading the code, I now see that behavior is actually exactly what I need it to be – but documentation is borderline unreadable. Submitting a PR to update it and to make ignore-case behavior configurable.
Is your feature request related to a problem? Please describe.
In current date and age, most DB engines do not care if any of the tokens are upper or lower case. One could argue that it is a good practice to keep keywords uppercase for readability, but sqlparse should not attempt to be an opinionated linter.
I need to detect "SELECT foo FROM bar INTO baz" statements, which is a quirky replacement for CREATE TABLE AS SELECT in MS SQL Server. I cannot use
Token.match
for this, however: I would need to explicitly list every single combination of uppercase and lowercase letters in SELECT (Select, select, etc.) if I wanted to use this method. This is 64 possible combinations. Not doing this.Describe the solution you'd like
An additional parameter (can still default to existing behavior) to allow case ignore when matching Keyword tokens.
Describe alternatives you've considered
Monkey patching my own function
Relevant doc page:
https://sqlparse.readthedocs.io/en/0.1.3/analyzing/#sqlparse.sql.Token.match
Relevant code:
sqlparse/sqlparse/sql.py
Line 90 in a2c7e64
The text was updated successfully, but these errors were encountered: