Provide useful (automatic) type coercions between Clojure and database(s)
Currently focused on JDBC and Postgres/PostGIS
(PostGIS support not currently implemented)
Include [com.dcj/coerce "some-version"] in your project.clj
Require [coerce.jdbc.pg] in your app/namespace
Current opinions:
next.jdbcis the JDBC library of choiceclojure.java-timeis the time library of choice- Add ThreeTen-Extra to get Interval
- Use
java.time.ZonedDateTimefor SQLtimestampand Postgrestimestamptz, and vice versa - Prefer
timestamptzwhenever possible UTCis the timezone of choice, and is the default and assumed- Use
org.threeten.extra.Intervalfor Postgreststzrange(preferred) andtsrange - Factual/geo is the geospatial library of choice
- Uber's H3 is the spatial index of choice, see also:
h3-pgandpgh3
See TODO.org in the base of this repo
Virtually all of the Postgres/PostGIS coercions were ported directly from Remod Oy's clj-postgresql and Aleh Atsman's fork, without their efforts this would not exist.
Sean Corfield developed next.jdbc, and answered numerous questions as I attempted to modify the existing clj-postgresql coercions to next.jdbc.
I am extremely grateful to Oy, Atsman, and Corfield for their generous contributions.
Given this is a modification of Oy's original work, his license applies