Skip to content

Commit

Permalink
Add a WITH nonsense
Browse files Browse the repository at this point in the history
  • Loading branch information
tsmacdonald committed Apr 8, 2024
1 parent 055569c commit 5688d0a
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/macaw/core_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,24 @@
(is (= #{"update"}
(mutations "UPDATE people SET name = 'Robert Fergusson' WHERE id = 23"))))

(deftest complicated-mutations-test
;; https://github.com/metabase/macaw/issues/18
#_ (is (= #{"delete" "insert"}
(mutations "WITH outdated_orders AS (
DELETE FROM orders
WHERE
date <= '2018-01-01'
RETURNING *
)
INSERT INTO order_log
SELECT * from outdated_orders;")))
(is (= #{ "insert"}
(mutations "WITH outdated_orders AS (
SELECT * from orders
)
INSERT INTO order_log
SELECT * from outdated_orders;"))))

(deftest alias-inclusion-test
(testing "Aliases are not included"
(is (= #{"orders" "foo"}
Expand Down

0 comments on commit 5688d0a

Please sign in to comment.