fromJson static method

RequiredTable fromJson(
  1. Map<String, dynamic> json
)
override

Implementation

static RequiredTable fromJson(Map<String, dynamic> json) {
  final rawSchema = json['schema'];
  if (rawSchema is! String) {
    throw RoomServerException("required table schema must be a base64 Arrow IPC schema");
  }

  return RequiredTable(
    name: json['table'] as String,
    schema: ArrowIpcSchema(Uint8List.fromList(base64Decode(rawSchema))).schema,
    namespace: (json['namespace'] as List?)?.cast<String>(),
    scalarIndexes: (json['scalar_indexes'] as List?)?.cast<String>(),
    fullTextSearchIndexes: (json['full_text_search_indexes'] as List?)?.cast<String>(),
    vectorIndexes: (json['vector_indexes'] as List?)?.cast<String>(),
  );
}