1234567module juptune.postgres.protocol.connection;
Result prepare(
const char[] statementName,
const char[] query,
PostgresDataTypeOid[] paramTypes
);
Sends a Prepare message (followed by a Sync message), which generates a prepared query that can then be used with bindDescribeExecute.
Under most circumstances, when an error is produced it is safe to continue using an instance of this struct as it will attempt to self-correct. User code should use .isReadyToQueryto double check whether continued use is safe.
This function can only be called once .connectsuccesfully executes.
PostgresProtocolError.bufferTooSmallif the buffer would exceed PostgresProtocolConfig.maxBufferSizewhen reading or writing.
PostgresProtocolError.unexpectedMessageif an unexpected message was returned by the server.
PostgresProtocolError.invalidMessageif a message returned by the server is in some way malformed.
PostgresProtocolError.notEnoughBytesif the server didn't send enough bytes than expected (more likely a Juptune parsing bug).
PostgresProtocolError.errorResponseif the server returned an ErrorResponse message.
Anything that .putand .receivefor TcpSocketand TlsSocketcan throw.
An errorful Resultif something went wrong.