enum PG::Backend

The messages a server sends, decoded.

src/backend.qz:20

Variants

variant PG::Backend::AuthenticationOk

Authentication succeeded.

src/backend.qz:22

variant PG::Backend::AuthenticationCleartextPassword

The server asks for the password in clear.

src/backend.qz:24

variant PG::Backend::AuthenticationMD5Password(salt: Bytes)

The server asks for the password hashed with MD5 and this salt.

src/backend.qz:26

variant PG::Backend::AuthenticationSASL(mechanisms: Array[String])

The server asks for SASL with one of these mechanisms.

src/backend.qz:28

variant PG::Backend::AuthenticationSASLContinue(data: Bytes)

A SASL challenge: the mechanism's data.

src/backend.qz:30

variant PG::Backend::AuthenticationSASLFinal(data: Bytes)

The SASL outcome: the mechanism's last data.

src/backend.qz:32

variant PG::Backend::AuthenticationOther(code: Int)

A method this client does not speak (Kerberos, GSSAPI, SSPI): its code.

src/backend.qz:35

variant PG::Backend::ParameterStatus(name: String, value: String)

A run-time parameter and its value, at startup and when it changes.

src/backend.qz:37

variant PG::Backend::BackendKeyData(process_id: Int, secret: Bytes)

The key a cancel request names: 4 bytes before protocol 3.2, up to 256 after.

src/backend.qz:40

variant PG::Backend::ReadyForQuery(status: String)

I idle, T in a transaction, E in a failed transaction.

src/backend.qz:42

variant PG::Backend::RowDescription(fields: Array[PG::Field])

The columns of the rows that follow.

src/backend.qz:44

variant PG::Backend::DataRow(values: Array[Bytes?])

Each column's value, nil for NULL.

src/backend.qz:46

variant PG::Backend::CommandComplete(tag: String)

A statement finished: its command tag (INSERT 0 1, SELECT 2).

src/backend.qz:48

variant PG::Backend::EmptyQueryResponse

The query was empty.

src/backend.qz:50

variant PG::Backend::ErrorResponse(fields: Hash[String, String])

The fields by their one-letter codes (S severity, C SQLSTATE, M message, D detail, H hint, P position, ...).

src/backend.qz:53

variant PG::Backend::NoticeResponse(fields: Hash[String, String])

A notice or warning, with the fields an error has.

src/backend.qz:55

variant PG::Backend::ParseComplete

A Parse succeeded.

src/backend.qz:57

variant PG::Backend::BindComplete

A Bind succeeded.

src/backend.qz:59

variant PG::Backend::CloseComplete

A Close succeeded.

src/backend.qz:61

variant PG::Backend::NoData

The statement or portal described returns no rows.

src/backend.qz:63

variant PG::Backend::PortalSuspended

Execute stopped at its row limit; the portal has more.

src/backend.qz:65

variant PG::Backend::ParameterDescription(types: Array[Int])

A prepared statement's parameter types (OIDs).

src/backend.qz:67

variant PG::Backend::NotificationResponse(process_id: Int, channel: String, payload: String)

A NOTIFY on a channel this session listens to.

src/backend.qz:69

variant PG::Backend::NegotiateProtocolVersion(minor: Int, options: Array[String])

The newest minor version the server speaks, and the startup options it did not recognize.

src/backend.qz:72

Class methods

def self.decode(type: Int, body: Bytes) -> PG::Backend

The message of type type (its byte) with the body body. Raises PG::ProtocolError for a type this client does not know (COPY's among them, for now) or a body that does not parse.

PG::Backend.decode('Z'.ord, b"I")   # => PG::Backend::ReadyForQuery(status: "I")

src/backend.qz:81