Decode the binary stream produced by Postgres' pgoutput logical
replication output plugin.
Each message starts with a one-byte type tag followed by
big-endian fixed-width integers and NUL-terminated (cstring) text.
decode turns one message's bytes into a map carrying an :op
keyword plus the fields of that message type; LSNs are longs (see
ebifriedrice.postlog.lsn) and commit timestamps are
java.time.Instants.
Tuple values arrive in one of four encodings, exposed as:
nil (SQL NULL), a UTF-8 string (text format), a byte array
(binary format, proto v2+ only), or unchanged-toast when a TOASTed
value was not modified by the change and the server skipped sending
it.
This decoder covers protocol version 1 message layouts, which is what postlog streams with. The in-progress-transaction stream messages (proto v2+) are rejected with a clear error rather than misparsed.
Decode the binary stream produced by Postgres' ``pgoutput`` logical replication output plugin. Each message starts with a one-byte type tag followed by big-endian fixed-width integers and NUL-terminated (cstring) text. [[decode]] turns one message's bytes into a map carrying an ``:op`` keyword plus the fields of that message type; LSNs are longs (see [[ebifriedrice.postlog.lsn]]) and commit timestamps are ``java.time.Instant``s. Tuple values arrive in one of four encodings, exposed as: ``nil`` (SQL NULL), a UTF-8 string (text format), a byte array (binary format, proto v2+ only), or [[unchanged-toast]] when a TOASTed value was not modified by the change and the server skipped sending it. This decoder covers protocol version 1 message layouts, which is what postlog streams with. The in-progress-transaction stream messages (proto v2+) are rejected with a clear error rather than misparsed.
(decode payload)Decode one pgoutput message from payload (bytes or ByteBuffer,
positioned at the type byte) into a map with an :op keyword.
Throws ex-info for message types postlog does not handle.
Decode one pgoutput message from `payload` (bytes or ByteBuffer, positioned at the type byte) into a map with an ``:op`` keyword. Throws ex-info for message types postlog does not handle.
Marker for a TOASTed column the server did not send because the change did not touch it. Only Update of a table with large values produces these; re-read the row if you need the real value.
Marker for a TOASTed column the server did not send because the change did not touch it. Only Update of a table with large values produces these; re-read the row if you need the real value.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |