Liking cljdoc? Tell your friends :D

ebifriedrice.postlog.decode

Decode the column values pgoutput sends into Clojure data, keyed by type OID.

pgoutput renders columns in one of two formats per stream: every column as its text representation (42, t, 2500.00), or with the protocol-v2 binary option, each type's binary wire form (int4 as four big-endian bytes, timestamps as microseconds since 2000-01-01, and so on — the layouts Postgres' typsend functions emit, verified identical on servers 14-17). Relation messages name each column's type only by OID, so both formats decode through an OID-keyed lookup: decode-value dispatches on the value being a string (text) or bytes (binary).

Values of unknown or custom types keep their raw text or bytes, and other values (NULL, unchanged-TOAST markers) pass through untouched.

Decode the column values pgoutput sends into Clojure data, keyed by
type OID.

pgoutput renders columns in one of two formats per stream: every
column as its text representation (``42``, ``t``, ``2500.00``), or
with the protocol-v2 ``binary`` option, each type's binary wire form
(int4 as four big-endian bytes, timestamps as microseconds since
2000-01-01, and so on — the layouts Postgres' typsend functions
emit, verified identical on servers 14-17).  Relation messages name
each column's type only by OID, so both formats decode through an
OID-keyed lookup: [[decode-value]] dispatches on the value being a
string (text) or bytes (binary).

Values of unknown or custom types keep their raw text or bytes, and
other values (NULL, unchanged-TOAST markers) pass through
untouched.
raw docstring

decode-valueclj

(decode-value type-oid value)

Decode one column value — text (string) or binary (bytes) — using its column's type-oid. Non-string/non-bytes values pass through untouched; unknown OIDs keep the raw text or bytes. This is the function to hand a consumer as :value-decoder.

Decode one column `value` — text (string) or binary (bytes) — using
its column's `type-oid`.  Non-string/non-bytes values pass through
untouched; unknown OIDs keep the raw text or bytes.  This is the
function to hand a consumer as ``:value-decoder``.
sourceraw docstring

infinityclj

Marker for date and timestamp values Postgres renders as infinity.

Marker for date and timestamp values Postgres renders as
``infinity``.
sourceraw docstring

neg-infinityclj

Marker for -infinity.

Marker for ``-infinity``.
sourceraw docstring

parse-array-literalclj

(parse-array-literal s)

Parse an array's text form into nested vectors of strings and nils (unquoted NULL); typed decoding maps over the result.

Parse an array's text form into nested vectors of strings and
nils (unquoted NULL); typed decoding maps over the result.
sourceraw docstring

parse-timestampclj

(parse-timestamp s)

Timestamp without time zone -> LocalDateTime.

Timestamp without time zone -> LocalDateTime.
sourceraw docstring

parse-timestamptzclj

(parse-timestamptz s)

Timestamp with time zone -> OffsetDateTime.

Timestamp with time zone -> OffsetDateTime.
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