inspect method

Future<Map<String, DataType>> inspect(
  1. String table, {
  2. List<String>? namespace,
})

Implementation

Future<Map<String, DataType>> inspect(String table, {List<String>? namespace}) async {
  final response = await _invoke("inspect", {"table": table, "namespace": namespace});
  if (response is! JsonContent) {
    throw RoomServerException("unexpected return type from database.inspect call");
  }
  final fields = response.json["fields"];
  if (fields is! List) {
    throw RoomServerException("unexpected return type from database.inspect call");
  }
  return {
    for (final rawField in fields)
      if (rawField is Map && rawField["name"] is String)
        rawField["name"] as String: DataType.fromJson(_publicDataTypeJson(rawField["data_type"])),
  };
}