SqlResultDto.fromJson constructor
Implementation
factory SqlResultDto.fromJson(Map<String, Object?> json) =>
switch (json['kind']) {
'read' => SqlResultDto.read(
columns: asStringList(json['columns']),
rows: asRows(json['rows']),
truncated: json['truncated'] == true,
),
'write' => SqlResultDto.write(affected: json['affected'] as int?),
'error' => SqlResultDto.error(json['error'] as String),
_ => throw ArgumentError.value(json['kind'], 'json', 'Invalid kind'),
};