From fc1ca82e4ed56bb65facf36568ce2cbc546bcf68 Mon Sep 17 00:00:00 2001 From: Sean Corfield Date: Thu, 10 Jan 2019 11:44:19 -0800 Subject: [PATCH] Add a quick'n'dirty query function For benchmarking overhead. --- src/next/jdbc.clj | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/next/jdbc.clj b/src/next/jdbc.clj index 39b9de0..4419817 100644 --- a/src/next/jdbc.clj +++ b/src/next/jdbc.clj @@ -410,6 +410,11 @@ (with-open [stmt (prepare con sql-params opts)] (reduce-stmt stmt f init)))))))) +(defn query + "" + [connectable sql-params & [opts]] + (into [] (map (partial into {})) (execute! connectable sql-params opts))) + (comment (def db-spec {:dbtype "h2:mem" :dbname "perf"}) (def con db-spec)