Message Types¶
This document contains autoclass definitions for all of the various message types used throughout the library. These are returned from all three layers of API, although some only at certain levels.
Base Classes¶
These classes are never returned directly, but are supertypes to other message classes.
- class pg_purepy.messages.PostgresMessage¶
Bases:
objectBase class for a PostgreSQL protocol message.
- class pg_purepy.messages.QueryResultMessage¶
Bases:
PostgresMessage,ABCSuperclass for query results.
State-related messages¶
These classes usually represent some form of internal state change.
- class pg_purepy.messages.ParameterStatus(name, value)¶
Bases:
PostgresMessageReturned when a configuration parameter is changed, e.g. via SET.
- class pg_purepy.messages.ErrorOrNoticeResponse(notice, recoverable, severity_localised, severity, code, message, hint=None, detail=None, position=None, internal_position=None, internal_query=None, where=None, schema_name=None, table_name=None, column_name=None, data_type_name=None, constraint_name=None)¶
Bases:
PostgresMessageReturned when an error or a notice message is produced from the server.
- class pg_purepy.messages.ReadyForQuery(state)¶
Bases:
PostgresMessageReturned when the protocol machine is ready for the next query cycle.
-
state:
ReadyForQueryState¶ The sub-state that the current connection is in.
-
state:
- class pg_purepy.messages.ReadyForQueryState(*values)¶
Bases:
EnumEnumeration of possible ReadyForQuery states.
- IDLE = 73¶
The server is idle and not in any transaction.
- IN_TRANSACTION = 84¶
The server is currently in a transaction, and new commands can be issued.
- ERRORED_TRANSACTION = 69¶
The server is currently in a transaction that has errored, and no new commands can be issued.
Auth-related messages¶
These classes relate to the authentication loop.
- class pg_purepy.messages.AuthenticationRequest(method, md5_salt=None, sasl_methods=NOTHING)¶
Bases:
PostgresMessageReturned when the PostgreSQL server requires authentication.
-
method:
AuthenticationMethod¶ The authentication method required.
-
method:
- class pg_purepy.messages.AuthenticationMethod(*values)¶
Bases:
IntEnumEnumeration of supported authentication methods.
- CLEARTEXT = 3¶
The server wishes for us to send our password in clear text.
- MD5 = 5¶
The server wishes for us to use MD5 hashing for our password.
- SASL = 10¶
The server wishes for us to use SASL authentication.
- class pg_purepy.messages.BackendKeyData(pid, secret_key)¶
Bases:
PostgresMessageMisc data used for cancellation.
- class pg_purepy.messages.AuthenticationCompleted¶
Bases:
PostgresMessageReturned when authentication is completed.
Query-related messages¶
These classes relate to parts of the query cycle.
Both simple and extended queries:
- class pg_purepy.messages.ColumnDescription(name, table_oid, column_index, type_oid, column_length, type_modifier)¶
Bases:
objectA description of a column.
- final class pg_purepy.messages.RowDescription(columns)¶
Bases:
QueryResultMessage,Sequence[ColumnDescription]Describes the rows of a query.
-
columns:
list[ColumnDescription]¶ The list of
ColumnDescriptioninstances that wraps the decoding info for each column returned in this row.
-
columns:
- final class pg_purepy.messages.DataRow(description, data)¶
Bases:
QueryResultMessage,Sequence[Any]A singular data row. This contains a
RowDescriptionand a list of converted data values.-
description:
RowDescription¶ The
RowDescriptionthat describes the data within this row.
-
description:
- class pg_purepy.messages.CommandComplete(tag, row_count)¶
Bases:
QueryResultMessageReturned when a single query command is complete.
Extended queries only:
- class pg_purepy.messages.ParseComplete(statement_name)¶
Bases:
PostgresMessageReturned when parsing a prepared statement completes.
- class pg_purepy.messages.ParameterDescription(oids)¶
Bases:
PostgresMessageReturned when parsing a ParameterDescription message.
- class pg_purepy.messages.PreparedStatementInfo(name, parameter_oids, row_description)¶
Bases:
PostgresMessageContains the state of a prepared statement. Returned for a RowDescription over a prepared statement.
-
parameter_oids:
ParameterDescription¶ The
ParameterDescriptionfor the parameters for this prepared statement.
-
row_description:
RowDescription|None¶ The
RowDescriptionof the incoming row data of the prepared statement. This may be None if this query doesn’t return any data.
-
parameter_oids:
- class pg_purepy.messages.BindComplete¶
Bases:
PostgresMessageReturned when a Bind message completes successfully.