seancorfield / next-jdbc

A modern low-level Clojure wrapper for JDBC-based access to databases.
https://cljdoc.org/d/com.github.seancorfield/next.jdbc/
Eclipse Public License 1.0
750 stars 89 forks source link

Consider with-transaction+options and on-connection+options #256

Closed seancorfield closed 9 months ago

seancorfield commented 11 months ago

Is your feature request related to a problem? Please describe. For people using with-options, it's inconvenient to have to manually rewrap a java.sql.Connection (produced by with-transaction and on-connection) with their options again. Provide a way to have next.jdbc auto-wrap the Connection object.

Describe the solution you'd like Variants of with-transaction and on-connection that auto-wrap the bound symbol with any options from the original "transactable" or "connectable".

Describe alternatives you've considered Modifying with-transaction and on-connection to do this automatically -- potentially breaking change since any existing code that assumes java.sql.Connection and performs interop on it would break.

seancorfield commented 11 months ago

Note to self: there is no with-connection because the assumption is you would use with-open and get-connection instead -- and only one of the four arities of get-connection could be used here by default.

seancorfield commented 11 months ago

Added on-connection+options.