diff --git a/src/honey/sql.cljc b/src/honey/sql.cljc index aef15b4..dc39b7e 100644 --- a/src/honey/sql.cljc +++ b/src/honey/sql.cljc @@ -1235,6 +1235,7 @@ ">")]) :array (fn [_ [arr]] + ;; allow for (unwrap arr) here? (let [[sqls params] (format-expr-list arr)] (into [(str "ARRAY[" (str/join ", " sqls) "]")] params))) :between diff --git a/test/honey/sql_test.cljc b/test/honey/sql_test.cljc index b0cdd82..efefb8b 100644 --- a/test/honey/sql_test.cljc +++ b/test/honey/sql_test.cljc @@ -207,7 +207,13 @@ (is (= (format {:insert-into :foo :columns [:baz] :values [[[:array ["one" "two" "three"]]]]}) - ["INSERT INTO foo (baz) VALUES (ARRAY[?, ?, ?])" "one" "two" "three"]))) + ["INSERT INTO foo (baz) VALUES (ARRAY[?, ?, ?])" "one" "two" "three"])) + #_ ;; requested feature -- does not work yet + (is (= (format {:insert-into :foo + :columns [:baz] + :values [[[:array :?vals]]]} + {:params {:vals [1 2 3 4]}}) + ["INSERT INTO foo (baz) VALUES (ARRAY[?, ?, ?, ?])" 1 2 3 4]))) (deftest union-test ;; UNION and INTERSECT subexpressions should not be parenthesized.