Skip to content

Initializer

init(from:type:format:context:)

Create an entity from the buffer in Postgres wire format.
init<JSONDecoder>(from buffer: inout ByteBuffer, type: PostgresDataType, format: PostgresFormat, context: PostgresDecodingContext<JSONDecoder>) where JSONDecoder : PostgresJSONDecoder

Parameters

buffer

A ByteBuffer to decode. The buffer is sliced in such a way that it is expected that the complete buffer is consumed for decoding.

type

The Postgres data type. Depending on this type the buffer’s bytes need to be interpreted in different ways.

format

The Postgres wire format. Can be .text or .binary.

context

A PostgresDecodingContext providing context for decoding. This includes a JSONDecoder to use when decoding JSON and metadata to create better errors.

Return Value

A decoded object.