Closed anthonygalea closed 3 years ago
@anthonygalea I think 3 would be most convenient and probably what most users would expect from a postgres + clojure tool. One choice we would have to make is if the deserialized JSON value should be keywordized using keywords, for example.
That sounds reasonable to me @borkdude. I think I'd opt to keywordize the keys in that case.
There may be some good ideas here:
https://github.com/dcj/coerce/blob/develop/src/coerce/jdbc/pg.clj
Implemented in v0.0.4.
See https://github.com/babashka/babashka-sql-pods/blob/master/CHANGELOG.md#v004.
Problem I was trying to write a babashka script that involves reading data from postgres. Some of this data is in a json column. When my query runs I see:
I've noticed that sql-pods uses the next.jdbc library so I tried following the advice here: https://cljdoc.org/d/seancorfield/next.jdbc/1.0.445/doc/getting-started/tips-tricks#working-with-json-and-jsonb but I got:
Possible solutions
next.jdbc
namespacesNote: Solution 2 worked fine in my case. Only posting this issue to identify if there are any usecases for which 2 is not appropriate.