PgStream
Represents a connection stream to a PostgreSQL database. Handles reading and writing of PostgreSQL wire protocol messages.
Parameters
Capacity of the buffer for asynchronous notifications.
Constructors
Properties
The transfer that last held this connection in copy mode, live or spent.
Seconds allowed for a cancel request sent on this connection's behalf, covering both its connect and its reads. Carried here for the same reason.
True while a COPY operation holds the connection in copy mode.
True while a statement is being executed on this connection, from the first message sent until the exchange is fully drained.
Timeout in seconds for the initial connection and login process.
The socket's read timeout, in milliseconds, with 0 meaning no limit.
The certificate the server presented during the TLS handshake, or null on a plaintext connection and on the rare TLS connection where the peer never authenticated itself.
The SSL settings this connection was established with, kept so that a second connection opened on its behalf - a cancel request - can be given the same treatment.
False until the startup handshake reaches its first ReadyForQuery.
The transaction status the server reported on its last ReadyForQuery: I outside a transaction block, T inside one, E inside one that has failed.
Functions
Blocks until the server closes this connection, discarding anything it sends beforehand.
Marks the start of an exchange, refusing to begin one while another is already running. Every call must be paired with endExchange in a finally.
Guards any operation that needs the protocol stream to itself.
Closes the socket without the Terminate that close sends first.
Marks the end of an exchange.
Attempts to receive a backend message if one is immediately available or within the timeout. Returns null if no message is available (e.g. timeout reached while polling).
Receives a single backend message synchronously, blocking until data is available.
Sends a frontend message to the PostgreSQL server.
Upgrades the current connection to use SSL/TLS.