Liking cljdoc? Tell your friends :D

datahike.pg.records

Composite / record values (PG record 2249 and named composite types).

A PgRecord carries its field values plus each field's OID and the record's own type OID (2249 for an anonymous ROW(...), or a named composite type's OID). The OIDs are needed for the binary wire codec (PG's record binary format is [nfields][per-field oid,len,data]); the values render to PG's canonical record_out text for text-format clients. Mirrors the role datahike.pg.arrays/PgArray plays for arrays.

Composite / record values (PG `record` 2249 and named composite types).

A `PgRecord` carries its field values plus each field's OID and the
record's own type OID (2249 for an anonymous `ROW(...)`, or a named
composite type's OID). The OIDs are needed for the binary wire codec
(PG's record binary format is [nfields][per-field oid,len,data]); the
values render to PG's canonical `record_out` text for text-format
clients. Mirrors the role `datahike.pg.arrays/PgArray` plays for arrays.
raw docstring

make-recordclj

(make-record oid-fn values)
(make-record oid-fn values type-oid)

Build a PgRecord from a seq of field values, inferring each field's OID via oid-fn (a value->oid function, e.g. types/infer-oid-from-value). type-oid defaults to 2249 (anonymous record).

Build a PgRecord from a seq of field values, inferring each field's OID
via `oid-fn` (a value->oid function, e.g. types/infer-oid-from-value).
`type-oid` defaults to 2249 (anonymous record).
sourceraw docstring

record?clj

(record? v)
source

register-layouts!clj

(register-layouts! reg-fn r)

Recursively register each PgRecord's field OIDs (via reg-fn — a 2-arg fn [record-text int-array-of-field-oids], i.e. PgParamCodec/registerRecordLayout) keyed by its canonical record_out text. Lets the anonymous-record binary encoder recover the per-field OIDs the text alone can't carry.

Recursively register each PgRecord's field OIDs (via `reg-fn` — a 2-arg fn
[record-text int-array-of-field-oids], i.e. PgParamCodec/registerRecordLayout)
keyed by its canonical record_out text. Lets the anonymous-record binary
encoder recover the per-field OIDs the text alone can't carry.
sourceraw docstring

to-pg-textclj

(to-pg-text r)

Render a PgRecord to PG's canonical record_out text: (f1,f2,...).

Render a PgRecord to PG's canonical `record_out` text: `(f1,f2,...)`.
sourceraw 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