Skip to content

Commit b4a2f07

Browse files
committed
GRANULARITY and QINTERVAL clauses added. Reindentation deleted for AND / OR operators.
1 parent 0e2382e commit b4a2f07

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

sqlparse/filters/reindent.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,10 @@ def nl(self):
4545
return sql.Token(T.Whitespace, self.n + self.char * self.leading_ws)
4646

4747
def _next_token(self, tlist, idx=-1):
48-
split_words = ('FROM', 'STRAIGHT_JOIN$', 'JOIN$', 'AND', 'OR',
48+
split_words = ('FROM', 'STRAIGHT_JOIN$', 'JOIN$', #'AND', 'OR',
4949
'GROUP', 'ORDER', 'UNION', 'VALUES',
50-
'SET', 'BETWEEN', 'EXCEPT', 'HAVING')
50+
'SET', 'BETWEEN', 'EXCEPT', 'HAVING', 'LIMIT',
51+
'GRANULARITY', 'QINTERVAL')
5152
m_split = T.Keyword, split_words, True
5253
tidx, token = tlist.token_next_by(m=m_split, idx=idx)
5354

sqlparse/keywords.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ def is_keyword(value):
275275
'GOTO': tokens.Keyword,
276276
'GRANT': tokens.Keyword,
277277
'GRANTED': tokens.Keyword,
278+
'GRANULARITY': tokens.Keyword,
278279
'GROUPING': tokens.Keyword,
279280

280281
'HANDLER': tokens.Keyword,
@@ -435,6 +436,8 @@ def is_keyword(value):
435436
'PROCEDURE': tokens.Keyword,
436437
'PUBLIC': tokens.Keyword,
437438

439+
'QINTERVAL': tokens.Keyword,
440+
438441
'RAISE': tokens.Keyword,
439442
'RAW': tokens.Keyword,
440443
'READ': tokens.Keyword,

0 commit comments

Comments
 (0)