xtdb

esp1 2024-10-17T00:20:52.613329Z

Is there a function available to transform return values from SQL into idiomatic Clojure data? I started out using XTQL, but it seems like some things aren't supported there yet (information schema, limit/offset arguments), so I'm thinking of switching to SQL for some things. However SQL returns data in a different form, e.g. keywords look like :foo$bar instead of :foo/bar, and Clojure data structures are represented as json in org.postgresql.util.PGobject objects.

seancorfield 2024-10-17T00:39:56.549539Z

Are you using next.jdbc for running SQL against XTDB?

esp1 2024-10-17T00:40:51.395079Z

Yes

seancorfield 2024-10-17T00:41:06.257479Z

If so, you can use a different :builder-fn to convert :foo$bar column names to :foo/bar, and the library docs have information for working with JSON/JSONB which will probably help you.

seancorfield 2024-10-17T00:43:10.717619Z

And this talks about how to write your own builders: https://cljdoc.org/d/com.github.seancorfield/next.jdbc/1.3.955/doc/getting-started/result-set-builders

seancorfield 2024-10-17T00:45:49.203699Z

I need to carve out some time to circle back around to working with XTDB -- I have a bunch of open issues on HoneySQL for adding support for XTDB's SQL extensions, and I want to make next.jdbc easier to use with it as well.

esp1 2024-10-17T00:46:14.476459Z

Thank you @seancorfield !

➕ 2