Handle empty :where SQL clauses in query.
This commit is contained in:
parent
54b1d268fa
commit
b545ddc0e1
1 changed files with 6 additions and 5 deletions
|
@ -170,11 +170,12 @@
|
||||||
[(map row columns-in-order) nil])))))
|
[(map row columns-in-order) nil])))))
|
||||||
|
|
||||||
(defn context->sql-clause [context]
|
(defn context->sql-clause [context]
|
||||||
{:select (sql-projection context)
|
(merge
|
||||||
:from (:from context)
|
{:select (sql-projection context)
|
||||||
:where (if (empty? (:wheres context))
|
:from (:from context)}
|
||||||
nil
|
(if (empty? (:wheres context))
|
||||||
(cons :and (:wheres context)))})
|
{}
|
||||||
|
{:where (cons :and (:wheres context))})))
|
||||||
|
|
||||||
(defn context->sql-string [context]
|
(defn context->sql-string [context]
|
||||||
(->
|
(->
|
||||||
|
|
Loading…
Reference in a new issue