From 90a6476e526450bad7f7ceed538c21f1d2a09300 Mon Sep 17 00:00:00 2001 From: Sean Corfield Date: Sat, 27 Jun 2020 14:09:54 -0700 Subject: [PATCH] Use execute-batch! to populate 1000 rows for testing foldable --- test/next/jdbc_test.clj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/next/jdbc_test.clj b/test/next/jdbc_test.clj index 2463025..9f87d15 100644 --- a/test/next/jdbc_test.clj +++ b/test/next/jdbc_test.clj @@ -298,9 +298,9 @@ VALUES ('Pear', 'green', 49, 47) (deftest folding-test (println "=== folding-test setup for" (:dbtype (db))) (jdbc/execute-one! (ds) ["delete from fruit"]) - (doseq [n (range 1 1001)] - (jdbc/execute-one! (ds) ["insert into fruit(name) values (?)" - (str "Fruit-" n)])) + (with-open [con (jdbc/get-connection (ds)) + ps (jdbc/prepare con ["insert into fruit(name) values (?)"])] + (prep/execute-batch! ps (mapv #(vector (str "Fruit-" %)) (range 1 1001)))) (println "=== folding-test running for" (:dbtype (db))) (testing "foldable result set" (testing "from a Connection"