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.jdbc
is the JDBC library of choiceclojure.java-time
is the time library of choice- Add ThreeTen-Extra to get Interval
- Use
java.time.ZonedDateTime
for SQLtimestamp
and Postgrestimestamptz
, and vice versa - Prefer
timestamptz
whenever possible UTC
is the timezone of choice, and is the default and assumed- Use
org.threeten.extra.Interval
for Postgreststzrange
(preferred) andtsrange
- Factual/geo is the geospatial library of choice
- Uber's H3 is the spatial index of choice, see also:
h3-pg
andpgh3
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