Web Development with Clojure, Third Edition: name confusing and missing fn/var page 218/219

@svmbrown

(json/read-value json/keyword-keys-object-mapper)

json/keyword-keys-object-mapper doesn’t exist

We’ve required cheshire.core’s generate-string and parse-string functions for working
with converting between JSON and EDN, and we’ve imported the classes for
which we’ll need to implement the IResultSetReadColumn and ISQLValue protocols.

Where is generate-string and parse-string used?

We’ve implemented IResultSetReadColumn for Array, returning a Clojure vector,
and for PGObjects of type JSON and JSONB, returning a Clojure map.

By json/read-value? Can you clarify?

Then, we’ve written a helper function to-pg-json to convert maps and vectors
to PGObjects. We use this function in our implementations of ISQLValue for IPersistentMap
and IPersistentVector to convert them into JSONB for use in queries.

Can you clarify to-pg-json as it’s not in the code? Did it mean write-pg-object and the extend-protocl right afterwards?

1 Like