Liking cljdoc? Tell your friends :D

datahike.pg.jsonb

PostgreSQL jsonb type support for the PgWire compatibility layer.

Stores jsonb values as Clojure data structures (maps, vectors, strings, numbers, booleans, nil) serialized to/from JSON strings via jsonista.

Implements PostgreSQL jsonb operators and functions as pure Clojure functions that can be used as Datalog predicates or post-processing.

PostgreSQL jsonb type support for the PgWire compatibility layer.

Stores jsonb values as Clojure data structures (maps, vectors, strings,
numbers, booleans, nil) serialized to/from JSON strings via jsonista.

Implements PostgreSQL jsonb operators and functions as pure Clojure
functions that can be used as Datalog predicates or post-processing.
raw docstring

format-jsonb-valueclj

(format-jsonb-value v)

Format a jsonb Clojure value for PgWire text protocol transport. Returns a JSON string.

Format a jsonb Clojure value for PgWire text protocol transport.
Returns a JSON string.
raw docstring

jsonb-array-elementsclj

(jsonb-array-elements v)

PostgreSQL jsonb_array_elements(jsonb): expand array to element rows.

PostgreSQL jsonb_array_elements(jsonb): expand array to element rows.
raw docstring

jsonb-array-elements-textclj

(jsonb-array-elements-text v)

PostgreSQL jsonb_array_elements_text(jsonb): expand array to text rows.

PostgreSQL jsonb_array_elements_text(jsonb): expand array to text rows.
raw docstring

jsonb-array-lengthclj

(jsonb-array-length v)

PostgreSQL jsonb_array_length(jsonb): return array length.

PostgreSQL jsonb_array_length(jsonb): return array length.
raw docstring

jsonb-build-arrayclj

(jsonb-build-array & args)

PostgreSQL jsonb_build_array(v1, v2, ...): build jsonb array.

PostgreSQL jsonb_build_array(v1, v2, ...): build jsonb array.
raw docstring

jsonb-build-objectclj

(jsonb-build-object & args)

PostgreSQL jsonb_build_object(k1, v1, k2, v2, ...): build jsonb from pairs.

PostgreSQL jsonb_build_object(k1, v1, k2, v2, ...): build jsonb from pairs.
raw docstring

jsonb-concatclj

(jsonb-concat left right)

PostgreSQL || operator: concatenate/merge two jsonb values.

PostgreSQL || operator: concatenate/merge two jsonb values.
raw docstring

jsonb-contained?clj

(jsonb-contained? left right)

PostgreSQL <@ operator: is left contained in right?

PostgreSQL <@ operator: is left contained in right?
raw docstring

jsonb-contains?clj

(jsonb-contains? left right)

PostgreSQL @> operator: does left contain right?

PostgreSQL @> operator: does left contain right?
raw docstring

jsonb-delete-idxclj

(jsonb-delete-idx v idx)

PostgreSQL - operator (int4): remove element by index from array.

PostgreSQL - operator (int4): remove element by index from array.
raw docstring

jsonb-delete-keyclj

(jsonb-delete-key v key)

PostgreSQL - operator (text): remove key from jsonb object.

PostgreSQL - operator (text): remove key from jsonb object.
raw docstring

jsonb-delete-keysclj

(jsonb-delete-keys v keys)

PostgreSQL - operator (text[]): remove multiple keys.

PostgreSQL - operator (text[]): remove multiple keys.
raw docstring

jsonb-delete-pathclj

(jsonb-delete-path v path)

PostgreSQL #- operator: remove element at path.

PostgreSQL #- operator: remove element at path.
raw docstring

jsonb-eachclj

(jsonb-each v)

PostgreSQL jsonb_each(jsonb): expand object to (key, value) rows. Returns sequence of [key value] pairs where value is jsonb.

PostgreSQL jsonb_each(jsonb): expand object to (key, value) rows.
Returns sequence of [key value] pairs where value is jsonb.
raw docstring

jsonb-each-textclj

(jsonb-each-text v)

PostgreSQL jsonb_each_text(jsonb): expand object to (key, value) rows. Returns sequence of [key text-value] pairs.

PostgreSQL jsonb_each_text(jsonb): expand object to (key, value) rows.
Returns sequence of [key text-value] pairs.
raw docstring

jsonb-exists-all?clj

(jsonb-exists-all? v keys)

PostgreSQL ?& operator: do all keys exist?

PostgreSQL ?& operator: do all keys exist?
raw docstring

jsonb-exists-any?clj

(jsonb-exists-any? v keys)

PostgreSQL ?| operator: does any of the keys exist?

PostgreSQL ?| operator: does any of the keys exist?
raw docstring

jsonb-exists?clj

(jsonb-exists? v key)

PostgreSQL ? operator: does key exist in jsonb object?

PostgreSQL ? operator: does key exist in jsonb object?
raw docstring

jsonb-getclj

(jsonb-get v key-or-idx)

PostgreSQL -> operator: get jsonb field by key (text) or element by index (int). Returns jsonb (Clojure data structure). Returns :null sentinel unchanged (NULL propagation for get-else).

PostgreSQL -> operator: get jsonb field by key (text) or element by index (int).
Returns jsonb (Clojure data structure).
Returns :__null__ sentinel unchanged (NULL propagation for get-else).
raw docstring

jsonb-get-pathclj

(jsonb-get-path v path)

PostgreSQL #> operator: extract jsonb at path. Path is a sequence of text keys.

PostgreSQL #> operator: extract jsonb at path.
Path is a sequence of text keys.
raw docstring

jsonb-get-path-textclj

(jsonb-get-path-text v path)

PostgreSQL #>> operator: extract text at path. Returns :__null__ sentinel when the path doesn't exist — returning nil would make Datahike's function-binding clause filter the row.

PostgreSQL #>> operator: extract text at path.
Returns `:__null__` sentinel when the path doesn't exist — returning nil
would make Datahike's function-binding clause filter the row.
raw docstring

jsonb-get-textclj

(jsonb-get-text v key-or-idx)

PostgreSQL ->> operator: get field/element as text string. Returns a string or :__null__ sentinel. Never returns nil — Datahike's function-binding clauses filter the row when the binding returns nil, but foo->>missing_key should produce SQL NULL while keeping the row.

PostgreSQL ->> operator: get field/element as text string.
Returns a string or `:__null__` sentinel. Never returns nil — Datahike's
function-binding clauses filter the row when the binding returns nil, but
`foo->>missing_key` should produce SQL NULL while keeping the row.
raw docstring

jsonb-insertclj

(jsonb-insert target path new-value)
(jsonb-insert target path new-value insert-after?)

PostgreSQL jsonb_insert(target, path, new_value, insert_after?): Insert value at path position in jsonb array.

PostgreSQL jsonb_insert(target, path, new_value, insert_after?):
Insert value at path position in jsonb array.
raw docstring

jsonb-object-agg-stepclj

(jsonb-object-agg-step acc k v)

Accumulator step for jsonb_object_agg(key, value).

Accumulator step for jsonb_object_agg(key, value).
raw docstring

jsonb-object-keysclj

(jsonb-object-keys v)

PostgreSQL jsonb_object_keys(jsonb): return keys of object. Returns a sequence (set-returning in SQL).

PostgreSQL jsonb_object_keys(jsonb): return keys of object.
Returns a sequence (set-returning in SQL).
raw docstring

jsonb-prettyclj

(jsonb-pretty v)

PostgreSQL jsonb_pretty(jsonb): pretty-print jsonb.

PostgreSQL jsonb_pretty(jsonb): pretty-print jsonb.
raw docstring

jsonb-setclj

(jsonb-set target path new-value)
(jsonb-set target path new-value create-missing?)

PostgreSQL jsonb_set(target, path, new_value, create_missing?): Set value at path in jsonb.

PostgreSQL jsonb_set(target, path, new_value, create_missing?):
Set value at path in jsonb.
raw docstring

jsonb-strip-nullsclj

(jsonb-strip-nulls v)

PostgreSQL jsonb_strip_nulls(jsonb): recursively remove null-valued keys.

PostgreSQL jsonb_strip_nulls(jsonb): recursively remove null-valued keys.
raw docstring

jsonb-typeofclj

(jsonb-typeof v)

PostgreSQL jsonb_typeof(jsonb): return type name as string.

PostgreSQL jsonb_typeof(jsonb): return type name as string.
raw docstring

parse-jsonbclj

(parse-jsonb v)

Parse a JSON string to a Clojure data structure. Returns nil for nil input, passes through non-strings.

Parse a JSON string to a Clojure data structure.
Returns nil for nil input, passes through non-strings.
raw docstring

serialize-jsonbclj

(serialize-jsonb v)

Serialize a Clojure data structure to a JSON string. Returns nil for nil input.

Serialize a Clojure data structure to a JSON string.
Returns nil for nil input.
raw docstring

to-jsonbclj

(to-jsonb v)

PostgreSQL to_jsonb(any): convert any value to jsonb.

PostgreSQL to_jsonb(any): convert any value to jsonb.
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close