Respect :gen-fn in execute-one

This commit is contained in:
Sean Corfield 2019-04-18 00:28:23 -07:00
parent 5019995feb
commit 50fbc5f8f1

View file

@ -262,8 +262,10 @@
(rest sql-params) (rest sql-params)
opts)] opts)]
(if-let [rs (stmt->result-set stmt opts)] (if-let [rs (stmt->result-set stmt opts)]
(let [gen-fn (get opts :gen-fn map-row-builder)
gen (gen-fn rs opts)]
(when (.next rs) (when (.next rs)
(datafiable-row (row-builder (map-row-builder rs opts)) this opts)) (datafiable-row (row-builder gen) this opts)))
{:next.jdbc/update-count (.getUpdateCount stmt)}))) {:next.jdbc/update-count (.getUpdateCount stmt)})))
(-execute-all [this sql-params opts] (-execute-all [this sql-params opts]
(with-open [stmt (prepare/create this (with-open [stmt (prepare/create this