PgEncoder

@author <a href="mailto:emad.albloushi@gmail.com">Emad Alblueshi</a> @author <a href="mailto:julien@julienviet.com">Julien Viet</a>

Constructors

this
this(PgDecoder dec, DList!(CommandCodecBase) inflight)
Undocumented in source.

Members

Functions

encode
void encode(Object message, Connection connection)
Undocumented in source. Be warned that the author may not have intended to support it.
flush
void flush()
Undocumented in source. Be warned that the author may not have intended to support it.
writeBind
void writeBind(Bind bind, string portal, List!(Variant) paramValues)

<p> The message gives the name of the prepared statement, the name of portal, and the values to use for any parameter values present in the prepared statement. The supplied parameter set must match those needed by the prepared statement. <p> The response is either {@link BindComplete} or {@link ErrorResponse}.

writeClosePortal
void writeClosePortal(string portal)

<p> The message closes an existing prepared statement or portal and releases resources. Note that closing a prepared statement implicitly closes any open portals that were constructed from that statement. <p> The response is either {@link CloseComplete} or {@link ErrorResponse}

writeDescribe
void writeDescribe(Describe describe)

<p> The message that using "statement" variant specifies the name of an existing prepared statement. <p> The response is a {@link ParamDesc} message describing the parameters needed by the statement, followed by a {@link RowDesc} message describing the rows that will be returned when the statement is eventually executed or a {@link NoData} message if the statement will not return rows. {@link ErrorResponse} is issued if there is no such prepared statement. <p> Note that since {@link Bind} has not yet been issued, the formats to be used for returned columns are not yet known to the backend; the format code fields in the {@link RowDesc} message will be zeroes in this case. <p> The message that using "portal" variant specifies the name of an existing portal. <p> The response is a {@link RowDesc} message describing the rows that will be returned by executing the portal; or a {@link NoData} message if the portal does not contain a query that will return rows; or {@link ErrorResponse} if there is no such portal.

writeExecute
void writeExecute(string portal, int rowCount)

The message specifies the portal and a maximum row count (zero meaning "fetch all rows") of the result. <p> The row count of the result is only meaningful for portals containing commands that return row sets; in other cases the command is always executed to completion, and the row count of the result is ignored. <p> The possible responses to this message are the same as {@link Query} message, except that it doesn't cause {@link ReadyForQuery} or {@link RowDesc} to be issued. <p> If Execute terminates before completing the execution of a portal, it will send a {@link PortalSuspended} message; the appearance of this message tells the frontend that another Execute should be issued against the same portal to complete the operation. The {@link CommandComplete} message indicating completion of the source SQL command is not sent until the portal's execution is completed. Therefore, This message is always terminated by the appearance of exactly one of these messages: {@link CommandComplete}, {@link EmptyQueryResponse}, {@link ErrorResponse} or {@link PortalSuspended}.

writeParse
void writeParse(Parse parse)

<p> The message contains a textual SQL query string. <p> The response is either {@link ParseComplete} or {@link ErrorResponse}

writePasswordMessage
void writePasswordMessage(PasswordMessage msg)
Undocumented in source. Be warned that the author may not have intended to support it.
writeQuery
void writeQuery(Query query)

<p> This message includes an SQL command (or commands) expressed as a text string. <p> The possible response messages from the backend are {@link CommandComplete}, {@link RowDesc}, {@link DataRow}, {@link EmptyQueryResponse}, {@link ErrorResponse}, {@link ReadyForQuery} and {@link NoticeResponse}

writeStartupMessage
void writeStartupMessage(StartupMessage msg)
Undocumented in source. Be warned that the author may not have intended to support it.
writeSync
void writeSync()

<p> The purpose of this message is to provide a resynchronization point for error recovery. When an error is detected while processing any extended-query message, the backend issues {@link ErrorResponse}, then reads and discards messages until this message is reached, then issues {@link ReadyForQuery} and returns to normal message processing. <p> Note that no skipping occurs if an error is detected while processing this message which ensures that there is one and only one {@link ReadyForQuery} sent for each of this message. <p> Note this message does not cause a transaction block opened with BEGIN to be closed. It is possible to detect this situation in {@link ReadyForQuery#txStatus()} that includes {@link TxStatus} information.

writeTerminate
void writeTerminate()

This message immediately closes the connection. On receipt of this message, the backend closes the connection and terminates.

Meta