PostgresNIO Documentation

Structure Postgres​Message

public struct PostgresMessage: Equatable  

A frontend or backend Postgres message.

%151 PostgresMessage PostgresMessage Equatable Equatable PostgresMessage->Equatable

Nested Types

PostgresMessage.Authentication

Authentication request returned by the server.

PostgresMessage.Bind

Identifies the message as a Bind command.

PostgresMessage.Close

Identifies the message as a Close Command

PostgresMessage.CommandComplete

Identifies the message as a Close command.

PostgresMessage.Describe

Identifies the message as a Describe command.

PostgresMessage.Execute

Identifies the message as an Execute command.

PostgresMessage.ParameterDescription

Identifies the message as a parameter description.

PostgresMessage.ParameterStatus
PostgresMessage.Parse

Identifies the message as a Parse command.

PostgresMessage.Password

Identifies the message as a password response. Note that this is also used for GSSAPI and SSPI response messages (which is really a design error, since the contained data is not a null-terminated string in that case, but can be arbitrary binary data).

PostgresMessage.ReadyForQuery

Identifies the message type. ReadyForQuery is sent whenever the backend is ready for a new query cycle.

PostgresMessage.SASLResponse

SASL ongoing challenge response message sent by the client.

PostgresMessage.SASLInitialResponse

SASL initial challenge response message sent by the client.

PostgresMessage.SSLRequest

A message asking the PostgreSQL server if SSL is supported For more info, see https://www.postgresql.org/docs/10/static/protocol-flow.html#id-1.10.5.7.11

PostgresMessage.SimpleQuery

Identifies the message as a simple query.

PostgresMessage.Startup

First message sent from the frontend during startup.

PostgresMessage.Sync

Identifies the message as a Bind command.

PostgresMessage.Terminate
PostgresMessage.BackendKeyData

Identifies the message as cancellation key data. The frontend must save these values if it wishes to be able to issue CancelRequest messages later.

PostgresMessage.DataRow

Identifies the message as a data row.

PostgresMessage.Error

First message sent from the frontend during startup.

PostgresMessage.Identifier

Identifies an incoming or outgoing postgres message. Sent as the first byte, before the message size. Values are not unique across all identifiers, meaning some messages will require keeping state to identify.

PostgresMessage.NotificationResponse

Identifies the message as a notification response.

PostgresMessage.RowDescription

Identifies the message as a row description.

Conforms To

Equatable

Initializers

init(identifier:​bytes:​)

public init<Data>(identifier: Identifier, bytes: Data)
        where Data: Sequence, Data.Element == UInt8

init(identifier:​data:​)

public init(identifier: Identifier, data: ByteBuffer)  

Properties

identifier

public var identifier: Identifier

data

public var data: ByteBuffer