applyToBuffer method
void
applyToBuffer(
- PgByteDataWriter buffer
)
override
Implementation
@override
void applyToBuffer(PgByteDataWriter buffer) {
buffer.writeUint8(ClientMessage.ParseIdentifier);
final statement = buffer.encodeString(_statement);
final statementName = buffer.encodeString(_statementName);
final length = 8 +
statement.bytesLength +
statementName.bytesLength +
_types.length * 4;
buffer.writeUint32(length);
// Name of prepared statement
buffer.writeEncodedString(statementName);
buffer.writeEncodedString(statement); // Query string
// Parameters and their types
buffer.writeUint16(_types.length);
for (final type in _types) {
buffer.writeInt32(type?.oid ?? 0);
}
}