Skip to content

Commit

Permalink
Added support for HAVING clause to y.c.db.util/query (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcorrado authored and devth committed Nov 5, 2018
1 parent ad4b3dc commit 43bbe84
Showing 1 changed file with 2 additions and 0 deletions.
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

0 comments on commit 43bbe84

Please sign in to comment.