Use execute-batch! to populate 1000 rows for testing foldable

This commit is contained in:
Sean Corfield 2020-06-27 14:09:54 -07:00
parent 7b24e2ff55
commit 90a6476e52

View file

@ -298,9 +298,9 @@ VALUES ('Pear', 'green', 49, 47)
(deftest folding-test (deftest folding-test
(println "=== folding-test setup for" (:dbtype (db))) (println "=== folding-test setup for" (:dbtype (db)))
(jdbc/execute-one! (ds) ["delete from fruit"]) (jdbc/execute-one! (ds) ["delete from fruit"])
(doseq [n (range 1 1001)] (with-open [con (jdbc/get-connection (ds))
(jdbc/execute-one! (ds) ["insert into fruit(name) values (?)" ps (jdbc/prepare con ["insert into fruit(name) values (?)"])]
(str "Fruit-" n)])) (prep/execute-batch! ps (mapv #(vector (str "Fruit-" %)) (range 1 1001))))
(println "=== folding-test running for" (:dbtype (db))) (println "=== folding-test running for" (:dbtype (db)))
(testing "foldable result set" (testing "foldable result set"
(testing "from a Connection" (testing "from a Connection"