CommandCompleteMessage constructor

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

Implementation

factory CommandCompleteMessage(Uint8List bytes, Encoding encoding) {
  final str = encoding.decode(bytes.sublist(0, bytes.length - 1));
  final match = _affectedRowsExp.firstMatch(str);
  var rowsAffected = 0;
  if (match != null) {
    rowsAffected = int.parse(match.group(0)!);
  }
  return CommandCompleteMessage._(rowsAffected);
}