Skip to content

Commit

Permalink
Identify TRUNCATE as DDL, REVOKE/GRANT as DCL keywords.
Browse files Browse the repository at this point in the history
See #719 as well.
  • Loading branch information
andialbrecht committed Mar 16, 2024
1 parent f55b4e1 commit d76e8a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Bug Fixes
* Allow operators to precede dollar-quoted strings (issue763).
* Fix parsing of nested order clauses (issue745, pr746 by john-bodley).
* Thread-safe initialization of Lexer class (issue730).
* Classify TRUNCATE as DDL and GRANT/REVOKE as DCL keywords (based on pr719
by josuc1, thanks for bringing this up!)


Release 0.4.4 (Apr 18, 2023)
Expand Down
6 changes: 3 additions & 3 deletions sqlparse/keywords.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,6 @@
'GLOBAL': tokens.Keyword,
'GO': tokens.Keyword,
'GOTO': tokens.Keyword,
'GRANT': tokens.Keyword,
'GRANTED': tokens.Keyword,
'GROUPING': tokens.Keyword,

Expand Down Expand Up @@ -477,7 +476,6 @@
'RETURNED_SQLSTATE': tokens.Keyword,
'RETURNING': tokens.Keyword,
'RETURNS': tokens.Keyword,
'REVOKE': tokens.Keyword,
'RIGHT': tokens.Keyword,
'ROLE': tokens.Keyword,
'ROLLBACK': tokens.Keyword.DML,
Expand Down Expand Up @@ -577,7 +575,6 @@
'TRIGGER_SCHEMA': tokens.Keyword,
'TRIM': tokens.Keyword,
'TRUE': tokens.Keyword,
'TRUNCATE': tokens.Keyword,
'TRUSTED': tokens.Keyword,
'TYPE': tokens.Keyword,

Expand Down Expand Up @@ -684,6 +681,9 @@
'DROP': tokens.Keyword.DDL,
'CREATE': tokens.Keyword.DDL,
'ALTER': tokens.Keyword.DDL,
'TRUNCATE': tokens.Keyword.DDL,
'GRANT': tokens.Keyword.DCL,
'REVOKE': tokens.Keyword.DCL,

'WHERE': tokens.Keyword,
'FROM': tokens.Keyword,
Expand Down

0 comments on commit d76e8a4

Please sign in to comment.