Closed Freid001 closed 5 years ago
I would like to be able to use the dry-run feature in sql korma. However, when I try to dry-run against a query which is being executed inside a for loop my test fails and returns "" as the response from dry-run.
""
my function
(defn update [items] (decorate-korma!) (for [item items] (-> (korma/update* entity) (korma/set-fields item) (korma/where {:entity (item :id)}) (korma/exec))))
my test
(testing "can update items" (is (= "dry run :: UPDATE `entity` SET `name` = ? WHERE (`id` = ?) :: [1]\n" (with-out-str (korma/dry-run (update [{:name "test" :id 1}]))))))
If I ignore with-out-str then I get a connections could not be acquired from the underlying database! exception.
with-out-str
I would like to be able to use the dry-run feature in sql korma. However, when I try to dry-run against a query which is being executed inside a for loop my test fails and returns
""
as the response from dry-run.my function
my test
If I ignore
with-out-str
then I get a connections could not be acquired from the underlying database! exception.