From d6693a90323bdc5598685ad2f01cebda690b5103 Mon Sep 17 00:00:00 2001 From: Sean Corfield Date: Fri, 26 Jun 2020 22:56:33 -0700 Subject: [PATCH] More stmt-sql bug fixing --- src/next/jdbc/result_set.clj | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/next/jdbc/result_set.clj b/src/next/jdbc/result_set.clj index 321e63d..cb42b0d 100644 --- a/src/next/jdbc/result_set.clj +++ b/src/next/jdbc/result_set.clj @@ -870,7 +870,8 @@ (-execute-one [this sql-params opts] (assert (= 1 (count sql-params)) "Parameters cannot be provided when executing a non-prepared Statement") - (if-let [rs (stmt-sql->result-set this (first sql-params))] + (if-let [rs (stmt-sql->result-set this (first sql-params) + (assoc opts :return-keys true))] (let [builder-fn (get opts :builder-fn as-maps) builder (builder-fn rs opts)] (when (.next rs) @@ -886,7 +887,8 @@ (.getConnection this) this go (assoc opts :return-keys true))] (recur (.getMoreResults this) (conj acc rs)) acc)) - (if-let [rs (stmt-sql->result-set this (first sql-params))] + (if-let [rs (stmt-sql->result-set this (first sql-params) + (assoc opts :return-keys true))] (datafiable-result-set rs (.getConnection this) opts) [{:next.jdbc/update-count (.getUpdateCount this)}])))