Abstract base class for extended query protocol messages. These can be buffered in memory locally
until a flush or sync message is received. Any corresponding database statement will only be
executed once a flush/sync is received.
Message of type bind (meaning that it is a message called to a prepared statement to complete it
with missing data to prepare for execution). A bound prepared statement always yields a portal
unless it fails.
This represents all messages which occur before ControlMessage type messages. Those
include encryption, admin (e.g.: cancellation) and start-up messages.
This message handles the imperative cancellation, as issues in a new connection by the PG wire
protocol. We expect that this message contains an ID for the connection which issues the original
query, as well as an auth secret.
Normally used to send data to the back-end. Spanner does not currently support this, so send will
throw a descriptive error to be sent to the user. Note that we do parse this in order for this to
be future proof, and to ensure the input stream is flushed of the command (in order to continue
receiving properly)
Normally used to signal a copy command is done. Spanner does not currently support copies, so
send will throw a descriptive error to be sent to the user. Note that we do parse this in order
for this to be future proof, and to ensure the input stream is flushed of the command (in order
to continue receiving properly)
Normally used to signal a copy command failed. Spanner does not currently support copies, so send
will throw a descriptive error to be sent to the user. Note that we do parse this in order for
this to be future proof, and to ensure the input stream is flushed of the command (in order to
continue receiving properly)
Normally used to send a function call the back-end. Spanner does not currently support this, so
send will throw a descriptive error to be sent to the user. Note that we do parse this in order
for this to be future proof, and to ensure the input stream is flushed of the command (in order
to continue receiving properly)
PGAdapter will convert a password message into gRPC authentication in the following ways:
If the username is 'oauth2' the password will be interpreted as an OAuth2 token.
If the username is an email address and the password contains private key section,
PGAdapter will construct a service account from the email address and private key.
Otherwise, PGAdapter will try to construct a Google credentials instance from the string in
the password message. The username will be ignored.
SkipMessage is a pseudo wire-protocol message that is used to read and skip messages that
we receive that we do not want at that time. This applies to COPY messages during normal
operation, and sync/flush messages during COPY operation.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Package com.google.cloud.spanner.pgadapter.wireprotocol (0.27.1)\n\nVersion latestkeyboard_arrow_down\n\n- [0.27.1 (latest)](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.wireprotocol)\n- [0.27.0](/java/docs/reference/pgadapter/0.27.0/com.google.cloud.spanner.pgadapter.wireprotocol)\n- [0.26.0](/java/docs/reference/pgadapter/0.26.0/com.google.cloud.spanner.pgadapter.wireprotocol)\n- [0.25.0](/java/docs/reference/pgadapter/0.25.0/com.google.cloud.spanner.pgadapter.wireprotocol)\n- [0.24.0](/java/docs/reference/pgadapter/0.24.0/com.google.cloud.spanner.pgadapter.wireprotocol)\n- [0.23.1](/java/docs/reference/pgadapter/0.23.1/com.google.cloud.spanner.pgadapter.wireprotocol)\n- [0.22.1](/java/docs/reference/pgadapter/0.22.1/com.google.cloud.spanner.pgadapter.wireprotocol)\n- [0.21.0](/java/docs/reference/pgadapter/0.21.0/com.google.cloud.spanner.pgadapter.wireprotocol)\n- [0.20.0](/java/docs/reference/pgadapter/0.20.0/com.google.cloud.spanner.pgadapter.wireprotocol)\n- [0.19.1](/java/docs/reference/pgadapter/0.19.1/com.google.cloud.spanner.pgadapter.wireprotocol)\n- [0.18.4](/java/docs/reference/pgadapter/0.18.4/com.google.cloud.spanner.pgadapter.wireprotocol)\n- [0.17.0](/java/docs/reference/pgadapter/0.17.0/com.google.cloud.spanner.pgadapter.wireprotocol)\n- [0.16.0](/java/docs/reference/pgadapter/0.16.0/com.google.cloud.spanner.pgadapter.wireprotocol)\n- [0.15.0](/java/docs/reference/pgadapter/0.15.0/com.google.cloud.spanner.pgadapter.wireprotocol)\n- [0.14.1](/java/docs/reference/pgadapter/0.14.1/com.google.cloud.spanner.pgadapter.wireprotocol)\n- [0.9.0](/java/docs/reference/pgadapter/0.9.0/com.google.cloud.spanner.pgadapter.wireprotocol)\n- [0.8.0](/java/docs/reference/pgadapter/0.8.0/com.google.cloud.spanner.pgadapter.wireprotocol)\n- [0.7.0](/java/docs/reference/pgadapter/0.7.0/com.google.cloud.spanner.pgadapter.wireprotocol)\n- [0.6.1](/java/docs/reference/pgadapter/0.6.1/com.google.cloud.spanner.pgadapter.wireprotocol)\n- [0.5.1](/java/docs/reference/pgadapter/0.5.1/com.google.cloud.spanner.pgadapter.wireprotocol) \n\nClasses\n-------\n\n### [AbstractQueryProtocolMessage](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.wireprotocol.AbstractQueryProtocolMessage)\n\nAbstract base class for extended query protocol messages. These can be buffered in memory locally\nuntil a flush or sync message is received. Any corresponding database statement will only be\nexecuted once a flush/sync is received.\n\n### [BindMessage](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.wireprotocol.BindMessage)\n\nMessage of type bind (meaning that it is a message called to a prepared statement to complete it\nwith missing data to prepare for execution). A bound prepared statement always yields a portal\nunless it fails.\n\n### [BootstrapMessage](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.wireprotocol.BootstrapMessage)\n\nThis represents all messages which occur before [ControlMessage](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.wireprotocol.ControlMessage) type messages. Those\ninclude encryption, admin (e.g.: cancellation) and start-up messages.\n\n### [CancelMessage](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.wireprotocol.CancelMessage)\n\nThis message handles the imperative cancellation, as issues in a new connection by the PG wire\nprotocol. We expect that this message contains an ID for the connection which issues the original\nquery, as well as an auth secret.\n\n### [CloseMessage](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.wireprotocol.CloseMessage)\n\nClose the designated statement.\n\n### [ControlMessage](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.wireprotocol.ControlMessage)\n\nGeneric representation for a control wire message: that is, a message which does not handle any\nform of start-up, but reather general communications.\n\n### [CopyDataMessage](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.wireprotocol.CopyDataMessage)\n\nNormally used to send data to the back-end. Spanner does not currently support this, so send will\nthrow a descriptive error to be sent to the user. Note that we do parse this in order for this to\nbe future proof, and to ensure the input stream is flushed of the command (in order to continue\nreceiving properly)\n\n### [CopyDoneMessage](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.wireprotocol.CopyDoneMessage)\n\nNormally used to signal a copy command is done. Spanner does not currently support copies, so\nsend will throw a descriptive error to be sent to the user. Note that we do parse this in order\nfor this to be future proof, and to ensure the input stream is flushed of the command (in order\nto continue receiving properly)\n\n### [CopyFailMessage](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.wireprotocol.CopyFailMessage)\n\nNormally used to signal a copy command failed. Spanner does not currently support copies, so send\nwill throw a descriptive error to be sent to the user. Note that we do parse this in order for\nthis to be future proof, and to ensure the input stream is flushed of the command (in order to\ncontinue receiving properly)\n\n### [DescribeMessage](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.wireprotocol.DescribeMessage)\n\nCalls describe on a portal or prepared statement.\n\n### [ExecuteMessage](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.wireprotocol.ExecuteMessage)\n\nExecutes a portal.\n\n### [FlushMessage](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.wireprotocol.FlushMessage)\n\nHandles a flush command from the user. This flushes any pending changes to Cloud Spanner and then\nsends any pending messages to the client.\n\n### [FunctionCallMessage](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.wireprotocol.FunctionCallMessage)\n\nNormally used to send a function call the back-end. Spanner does not currently support this, so\nsend will throw a descriptive error to be sent to the user. Note that we do parse this in order\nfor this to be future proof, and to ensure the input stream is flushed of the command (in order\nto continue receiving properly)\n\n### [ParseMessage](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.wireprotocol.ParseMessage)\n\nCreates a prepared statement.\n\n### [PasswordMessage](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.wireprotocol.PasswordMessage)\n\nPGAdapter will convert a password message into gRPC authentication in the following ways:\n\n1. If the username is 'oauth2' the password will be interpreted as an OAuth2 token.\n2. If the username is an email address and the password contains private key section, PGAdapter will construct a service account from the email address and private key.\n3. Otherwise, PGAdapter will try to construct a Google credentials instance from the string in the password message. The username will be ignored.\n\n### [QueryMessage](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.wireprotocol.QueryMessage)\n\nExecutes a simple statement.\n\n### [SSLMessage](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.wireprotocol.SSLMessage)\n\nHandles SSL bootstrap message.\n\n### [SkipMessage](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.wireprotocol.SkipMessage)\n\n[SkipMessage](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.wireprotocol.SkipMessage) is a pseudo wire-protocol message that is used to read and skip messages that\nwe receive that we do not want at that time. This applies to COPY messages during normal\noperation, and sync/flush messages during COPY operation.\n\n### [StartupMessage](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.wireprotocol.StartupMessage)\n\nThe first (non-encryption, non-admin) message expected in from a client in a connection loop.\nHere we handle metadata and authentication if any.\n\n### [SyncMessage](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.wireprotocol.SyncMessage)\n\nHandles a sync command from the user. JDBC does not require this step, so server-side this is a\nnoop.\n\n### [TerminateMessage](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.wireprotocol.TerminateMessage)\n\nCloses a connection.\n\n### [WireMessage](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.wireprotocol.WireMessage)\n\nGeneric representation for a wire message, generally executed by calling send.\n\nEnums\n-----\n\n### [ControlMessage.ManuallyCreatedToken](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.wireprotocol.ControlMessage.ManuallyCreatedToken)\n\nToken that is used to mark [ControlMessage](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.wireprotocol.ControlMessage)s that are manually created to execute a\n[QueryMessage](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.wireprotocol.QueryMessage).\n\n### [ControlMessage.PreparedType](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.wireprotocol.ControlMessage.PreparedType)"]]