count method

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

Implementation

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