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

Like `next.jdbc/with-logging`, but for time #251

Closed vemv closed 1 year ago

vemv commented 1 year ago

Is your feature request related to a problem? Please describe. Measuring SQL performance is a common need.

It's not always possible to add a time call to things, especially for 3rd party code.

Describe the solution you'd like A Connectable façade, similar to (composable with?) next.jdbc/with-logging.

Describe alternatives you've considered Maybe with-logging itself could be extended to invoke its sql-logger fn with the timing info as extra data.

Thanks - V

seancorfield commented 1 year ago

Does this provide a starting point for what you need? https://cljdoc.org/d/com.github.seancorfield/next.jdbc/1.3.874/doc/getting-started#naive-logging-with-timing

seancorfield commented 1 year ago

From @vemv on Slack:

My only 'complaint' is that I couldn't see that that was a (presumably) usual use of result-logger . Its description in the docstring seemed a bit abstract at the time. I also had grepped the repo for time , no results If, for instance, See doc-link for a time-measuring example was added to the docstring, we could surely consider the issue closed.

vemv commented 1 year ago

Thanks!