diff --git a/README.md b/README.md index 14af7e5..9d6d7fb 100644 --- a/README.md +++ b/README.md @@ -511,7 +511,7 @@ RIGHT JOIN bock ON bock.z = c.e WHERE ((f.a = ?) AND (b.baz <> ?)) OR ((? < ?) AND (? < ?)) OR (f.e IN (?, ?, ?)) OR f.e BETWEEN ? AND ? GROUP BY f.a, c.e HAVING ? < f.e -ORDER BY b.baz DESC, c.quux, f.a NULLS FIRST +ORDER BY b.baz DESC, c.quux ASC, f.a NULLS FIRST LIMIT ? OFFSET ? " diff --git a/src/honey/sql.cljc b/src/honey/sql.cljc index 472f624..6cdd51a 100644 --- a/src/honey/sql.cljc +++ b/src/honey/sql.cljc @@ -619,9 +619,8 @@ (str " " (first sqls)) (str "(" (str/join ", " sqls) ")")))] params))) - (if *inline* - [(str "(" (str/join ", " (map #'sqlize-value x)) ")")] - (into [(str "(" (str/join ", " (repeat (count x) "?")) ")")] x)))) + (let [[sqls params] (format-expr-list x)] + (into [(str "(" (str/join ", " sqls) ")")] params)))) (or (true? x) (false? x)) ; because (boolean? x) requires Clojure 1.9+ [(upper-case (str x))] @@ -760,4 +759,9 @@ {:dialect :mysql})) (println (format {:select [:*] :from [:table] :where [:in :id [1 2 3 4]]} {:pretty? true})) + (println (format {:select [:*] :from [:table] + :where [:and [:in :id [1 [:param :foo]]] + [:= :bar [:param :quux]]]} + {:params {:foo 42 :quux 13} + :pretty? true})) ,)