restore function call test using sql/call
This commit is contained in:
parent
a0b73cdcc6
commit
9ab7d3a2f8
1 changed files with 7 additions and 0 deletions
|
|
@ -115,6 +115,13 @@
|
||||||
:order-by [[:amount :asc]]})
|
:order-by [[:amount :asc]]})
|
||||||
["SELECT amount, id, created_on FROM transactions UNION SELECT amount, id, created_on FROM (SELECT amount, id, created_on FROM other_transactions ORDER BY amount DESC LIMIT ?) ORDER BY amount ASC" 5]))))
|
["SELECT amount, id, created_on FROM transactions UNION SELECT amount, id, created_on FROM (SELECT amount, id, created_on FROM other_transactions ORDER BY amount DESC LIMIT ?) ORDER BY amount ASC" 5]))))
|
||||||
|
|
||||||
|
(deftest compare-expressions-test
|
||||||
|
(testing "sql/call should produce appropriate function calls"
|
||||||
|
(is (= ["SELECT foo FROM bar WHERE (col1 mod ?) = (col2 + ?)" 4 4]
|
||||||
|
(format {:select [:foo]
|
||||||
|
:from [:bar]
|
||||||
|
:where (sql/call := (sql/call :mod :col1 4) (sql/call :+ :col2 4))})))))
|
||||||
|
|
||||||
(deftest union-with-cte
|
(deftest union-with-cte
|
||||||
(is (= (format {:union [{:select [:foo] :from [:bar1]}
|
(is (= (format {:union [{:select [:foo] :from [:bar1]}
|
||||||
{:select [:foo] :from [:bar2]}]
|
{:select [:foo] :from [:bar2]}]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue