-
Notifications
You must be signed in to change notification settings - Fork 136
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
support having #171
base: develop
Are you sure you want to change the base?
support having #171
Conversation
src/infi/clickhouse_orm/query.py
Outdated
@@ -392,6 +393,9 @@ def as_sql(self): | |||
if self._grouping_with_totals: | |||
sql += ' WITH TOTALS' | |||
|
|||
if self._having: | |||
sql += '\nhaving ' + self.having_as_sql() |
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.
it makes sense to use caps i.e. HAVING
in order to keep the style
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.
ok,, I change it.
src/infi/clickhouse_orm/query.py
Outdated
@@ -442,6 +452,14 @@ def order_by(self, *field_names): | |||
qs._order_by = field_names | |||
return qs | |||
|
|||
def having(self, having_str): |
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.
what is having_str
?
are you proposing to provide a condition just as a string?
It's a bit changing the concept of ORM, unlike when we do filter
there is kwargs approach
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.
I use Q function to support HAVING. Thanks to check it
No description provided.