Skip to content

Commit 8bf78a0

Browse files
ksakargayenandialbrecht
authored andcommitted
Added HAVING class
added a class named Having and inherited it with TokenList It will be easier for further manipulations as a HAVING clause contains multiple conditions just like WHERE clause
1 parent e59b608 commit 8bf78a0

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

sqlparse/sql.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,12 @@ class Where(TokenList):
531531
M_CLOSE = T.Keyword, (
532532
'ORDER', 'GROUP', 'LIMIT', 'UNION', 'UNION ALL', 'EXCEPT',
533533
'HAVING', 'RETURNING', 'INTO')
534+
535+
536+
class Having(TokenList):
537+
"""A HAVING clause."""
538+
M_OPEN = T.Keyword, 'HAVING'
539+
M_CLOSE = T.Keyword, ('ORDER', 'LIMIT')
534540

535541

536542
class Case(TokenList):

0 commit comments

Comments
 (0)