clj-r2dbc.dialect.impl.postgresql

Internal PostgreSQL-specific utilities for clj-r2dbc.

Provides:
  load-json-reflection - reflectively loads the io.r2dbc.postgresql.codec.Json class.
  coerce-row-json      - applies JSON decoding to matching column values in a row map.

This namespace is an implementation detail; do not use from application code.

coerce-row-json

(coerce-row-json row json-class as-string json->clj)
Apply JSON decoding to every column value in row that is an instance of json-class.

Args:
  row        - row map to transform.
  json-class - the io.r2dbc.postgresql.codec.Json Class.
  as-string  - reflected Method for Json.asString().
  json->clj  - 1-arity fn [json-string] -> Clojure value.

Returns a new map with JSON column values decoded; non-JSON values are unchanged.

load-json-reflection

(load-json-reflection)
Load the PostgreSQL Json codec class by reflection.

Returns a map {:json-class Class, :as-string Method} on success, or nil when
the class is not on the classpath (r2dbc-postgresql driver not present).