decodeArray method

dynamic decodeArray(
  1. String value,
  2. int pgType, {
  3. String? connectionName,
})

Decodes an array value, value. Each item of it is pgType.

Implementation

decodeArray(String value, int pgType, {String? connectionName}) {
  final len = value.length - 2;
  assert(value.codeUnitAt(0) == $lbrace && value.codeUnitAt(len + 1) == $rbrace);
  if (len <= 0) return [];
  value = value.substring(1, len + 1);

  return _parseArray(value, len, pgType, connectionName);
    //[decodeValue] is identity for text types, jsonDecode for json
    //(a json null arrives quoted ("null") → decodes to null)
}