getById method

  1. @override
Future<Map<String, dynamic>> getById(
  1. String table,
  2. String primaryColumn,
  3. int id
)

Return data that is referenced by the given Id in the table.

Implementation

@override
Future<Map<String, dynamic>> getById(
  String table,
  String primaryColumn,
  int id,
) async {
  final response =
      await _from(table).select().eq(primaryColumn, id).single().execute();
  if (response.error != null) {
    throw response.error!;
  }
  return response.data as Map<String, dynamic>;
}