by method

  1. @override
Future<List<Map<String, dynamic>>> by(
  1. String table,
  2. String key,
  3. dynamic value
)

Return data that is referenced by the given key and the value.

Implementation

@override
Future<List<Map<String, dynamic>>> by(
  String table,
  String key,
  dynamic value,
) async {
  final response = await _from(table).select().eq(key, value).execute();
  if (response.error != null) {
    throw response.error!;
  }
  return (response.data as List<dynamic>).cast<Map<String, dynamic>>();
}