[2.x] Using Clojure's next.jdbc with XTDB 2.0

For Clojure users exploring XTDB 2.0 Early Access and interested in the SQL API:

seancorfield/next.jdbc.xt: Experimental extension of next.jdbc to work with XTDB 2.0 (snapshots) (github.com)

Also, note that you can use HoneySQL to construct the SQL + params vector that the XTDB SQL API uses.

Both of these are possible due to moving the SQL transaction and query param syntax to be closer to the Clojure SQL ecosystem by jarohen · Pull Request #2515 · xtdb/xtdb (github.com) – and I’d like to give a big shoutout to the XTDB team for their responsiveness and receptiveness to early feedback on 2.0!

4 Likes

Very cool - thanks for this @seancorfield !

It’s perhaps worth mentioning that I spent an hour or two last year scratching the surface of extending HoneySQL with the SQL:2011 bitemporal syntax: core2-playground/notebook.clj at fa77488dc3733f88baa4ddc05384f1fe2863cab1 · xtdb/core2-playground · GitHub (NOTE: this notebook code uses the pgwire server + postgres client, meaning it also contains a lot of workarounds that are now completely irrelevant given Sean’s module…which bypasses many layers of complexity! I’ll have to create a new version :slight_smile:)

1 Like

Since that’s all(?) standard SQL syntax, I’d be happy to add any/all of it directly to HoneySQL.

Feel free to create GitHub issues with details (since I’m not familiar with the temporal SQL stuff… yet!). See also Support FOR SYSTEM_TIME on table names · Issue #407 · seancorfield/honeysql (github.com)

2 Likes