Fork me on GitHub
#sql
<
2018-11-22
>
curtis.summers17:11:49

HugSQL doesn't touch transactions--it just calls clojure.java.jdbc/execute! for :returning-execute queries: Operative line here: https://github.com/layerware/hugsql/blob/d0a0c790256a82809d4bd2adac9e812f06962542/hugsql-adapter-clojure-java-jdbc/src/hugsql/adapter/clojure_java_jdbc.clj#L12

seancorfield18:11:07

(which makes no sense to me for an insert)

curtis.summers21:11:52

You're right. I'd have to go remind myself about the details of this, but I'm guessing that it calls clojure.java.jdbc/query in order to returning a result set for the SQL RETURNING clause. Can I get the same thing out of clojure.java.jdbc/execute!? If so, has this always been the case?

seancorfield21:11:14

I'd have to try it to answer you for sure...

seancorfield21:11:32

I plan to create a repro of @ccann’s use case above -- but it occurred to me that the rollback may not reset the auto-increment IDs in MySQL so those would just keep incrementing anyway. Probably will try this over the weekend.

curtis.summers21:11:23

Yep, no rush here...Happy Thanksgiving. And thanks for clojure.java.jdbc!

seancorfield21:11:34

You're welcome 🙂 I'm working today, but planning to have dinner with friends later. Even after nearly 20 years in the U.S. I still find Thanksgiving weird 🙂