count method

Future<int> count({
  1. required String table,
  2. String? text,
  3. List<double>? vector,
  4. Object? where,
  5. List<String>? namespace,
  6. String? branch,
  7. int? version,
})

Implementation

Future<int> count({
  required String table,
  String? text,
  List<double>? vector,
  Object? where,
  List<String>? namespace,
  String? branch,
  int? version,
}) async {
  final response = await _invoke("count", {
    "table": table,
    "text": text,
    "vector": vector,
    "text_columns": null,
    "where": _whereClause(where),
    "namespace": namespace,
    "branch": branch,
    "version": version,
  });
  if (response is! JsonContent) {
    throw RoomServerException("unexpected return type from datasets.count call");
  }
  final count = response.json["count"];
  if (count is! num) {
    throw RoomServerException("unexpected return type from datasets.count call");
  }
  return count.toInt();
}