Skip to content
Snippets Groups Projects
Commit 89ce9a5b authored by Allen Gilliland's avatar Allen Gilliland
Browse files

extend our `realize-json` function to handle the case where the column is of...

extend our `realize-json` function to handle the case where the column is of type org.postgresql.util.PGobject which happens if the postgres column type is 'json'.
parent cb732526
No related branches found
No related tags found
No related merge requests found
......@@ -25,8 +25,10 @@
(defn- read-json-str-or-clob
"If JSON-STRING is a JDBC Clob, convert to a String. Then call `json/read-str`."
[json-str]
(some-> (if-not (= (type json-str) org.h2.jdbc.JdbcClob) json-str
(u/jdbc-clob->str json-str))
(some-> (cond
(= (type json-str) org.h2.jdbc.JdbcClob) (u/jdbc-clob->str json-str)
(= (type json-str) org.postgresql.util.PGobject) (.getValue json-str)
:else json-str)
cheshire/parse-string))
(defn realize-json
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment