Add a quick'n'dirty query function

For benchmarking overhead.
This commit is contained in:
Sean Corfield 2019-01-10 11:44:19 -08:00
parent 4ae5b44a52
commit fc1ca82e4e

View file

@ -410,6 +410,11 @@
(with-open [stmt (prepare con sql-params opts)] (with-open [stmt (prepare con sql-params opts)]
(reduce-stmt stmt f init)))))))) (reduce-stmt stmt f init))))))))
(defn query
""
[connectable sql-params & [opts]]
(into [] (map (partial into {})) (execute! connectable sql-params opts)))
(comment (comment
(def db-spec {:dbtype "h2:mem" :dbname "perf"}) (def db-spec {:dbtype "h2:mem" :dbname "perf"})
(def con db-spec) (def con db-spec)