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 init-fn for next.jdbc.connection/component #237

Closed seancorfield closed 1 year ago

seancorfield commented 1 year ago

Is your feature request related to a problem? Please describe. It's quite common that folks might want a specific function to run against the database when the connection pool is first created/started. Provide a way to supply that.

Describe the solution you'd like An optional argument to component that specifies a function that will be called at startup on the pooled datasource.

Describe alternatives you've considered Writing your own Component to wrap ->pool and call init-fn directly if supplied.