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

Document PGInterval to Duration handling for postgres #163

Closed snorremd closed 3 years ago

snorremd commented 3 years ago

Postgres supports a non-standard Interval type which is implemented as the PGInterval type in the postgres jdbc driver. Many users would likely want to deal with intervals as the standard java.time.Duration type. How this can be done is documented under tips & tricks.

As suggested on twitter: https://twitter.com/seancorfield/status/1386077001883127809.

Thank you for the library and excellent documentation. Hope this PR adds useful documentation for others. I've tried to keep in line with the existing code example style in terms of function and parameter naming and REPL friendliness.

Edit: Feel free to make any adjustments you see fit.

seancorfield commented 3 years ago

Much appreciated!