Skip to content
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

Added support for HAVING clause to y.c.db.util/query #54

Merged
merged 1 commit into from
Nov 5, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/yetibot/core/db/util.clj
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
where-args :where/args
;; optional
group-clause :group/clause
having-clause :having/clause
order-clause :order/clause
offset-clause :offset/clause
limit-clause :limit/clause
Expand All @@ -113,6 +114,7 @@
" FROM " (qualified-table-name table)
(when-not (blank? where-clause) (str " WHERE " where-clause))
(when group-clause (str " GROUP BY " group-clause))
(when having-clause (str " HAVING " having-clause))
(when order-clause (str " ORDER BY " order-clause))
(when offset-clause (str " OFFSET " offset-clause))
(when limit-clause (str " LIMIT " limit-clause)))]
Expand Down