Marmos
v juptune
v asn1
v lang
v ast
v Classes
v Enums
v ir
v parser
v Enums
v Structs
v core
v crypto
v keyexchange
v memory
v data
v alphabet
v buffer
v json
v builder
v parser
v Enums
v Structs
v serialise
v Structs
v Templates
v pem
v Enums
v Structs

Functions PostgresProtocol.prepare

1
2
3
4
5
6
7
module juptune.postgres.protocol.connection;

Result prepare(
    const char[] statementName, 
    const char[] query, 
    PostgresDataTypeOid[] paramTypes
);

Documentation

Sends a Prepare message (followed by a Sync message), which generates a prepared query that can then be used with bindDescribeExecute.

Notes

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.

Assertions

This function can only be called once .connectsuccesfully executes.

Params

Throws

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.

Returns

An errorful Resultif something went wrong.