adds tests for :union and :union-all
This commit is contained in:
parent
22b0d15283
commit
2123c01fb5
1 changed files with 10 additions and 0 deletions
|
|
@ -53,3 +53,13 @@
|
|||
:columns [:baz]
|
||||
:values [[#sql/array ["one" "two" "three"]]]})
|
||||
["INSERT INTO foo (baz) VALUES (ARRAY[?, ?, ?])" "one" "two" "three"])))
|
||||
|
||||
(deftest union-test
|
||||
(is (= (format {:union [{:select [:foo] :from [:bar1]}
|
||||
{:select [:foo] :from [:bar2]}]})
|
||||
["(SELECT foo FROM bar1) UNION (SELECT foo FROM bar2)"])))
|
||||
|
||||
(deftest union-all-test
|
||||
(is (= (format {:union-all [{:select [:foo] :from [:bar1]}
|
||||
{:select [:foo] :from [:bar2]}]})
|
||||
["(SELECT foo FROM bar1) UNION ALL (SELECT foo FROM bar2)"])))
|
||||
|
|
|
|||
Loading…
Reference in a new issue