12345678910111213141516171819202122232425module juptune.postgres.protocol.connection;
Result bindDescribeExecute(
const char[] statementName,
PostgresColumnDescription.Format[] paramFormatCodes,
PostgresColumnDescription.Format[] resultFormatCodes,
Result function(
const int paramIndex,
PostgresProtocol psql,
bool moreParamsLeftToBind
) bindParameterOrNull,
Result function(
ushort columnCount,
Result function(
PostgresColumnDescription desc
) nextDescription
) onRowDescriptionOrNull,
Result function(
ushort columnCount,
Result function(
MemoryReader valueReader,
bool isNull
) nextData
) onDataRowOrNull
);
Sends a Bind, Describe, and Execute message (followed by a Sync message) simultaneously, which effectively binds parameters onto a prepared statement; describes what the return results are, and then executes the query which provides the actual return results.
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.
Anything that bindParameterOrNull, onRowDescriptionOrNull, and onDataRowOrNullcan throw.
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.