RelationMessage constructor

RelationMessage(
  1. Uint8List bytes,
  2. Encoding encoding
)

Implementation

RelationMessage(Uint8List bytes,Encoding encoding) {
  final reader = ByteDataReader()..add(bytes);
  // reading order matters
  relationID = reader.readUint32();
  nameSpace = reader.decodeString(encoding);
  relationName = reader.decodeString(encoding);
  replicaIdentity = reader.readUint8();
  columnNum = reader.readUint16();

  for (var i = 0; i < columnNum; i++) {
    // reading order matters
    final flags = reader.readUint8();
    final name = reader.decodeString(encoding);
    final dataType = reader.readUint32();
    final typeModifier = reader.readUint32();
    columns.add(
      RelationMessageColumn(
        flags: flags,
        name: name,
        dataType: dataType,
        typeModifier: typeModifier,
      ),
    );
  }
}