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
760 stars 90 forks source link

Allow execute-batch! to work on connectable/sourceable #161

Closed seancorfield closed 3 years ago

seancorfield commented 3 years ago

Is your feature request related to a problem? Please describe. execute-batch! requires users to create a PreparedStatement themselves which made sense when it was in next.jdbc.prepare but makes less sense now there's a version in next.jdbc.

Describe the solution you'd like next.jdbc/execute-batch! should accept the same types of DB references that execute! et al take -- preferably by extending the protocol to include some version of execute-batch!.

Describe alternatives you've considered The top-level function could dynamically test the argument type. A new wrapper could be added. The documentation could just show how to call next.jdbc/prepare and then next.jdbc/execute-batch!.

Caveat: make sure extending the protocol is not a breaking change!