getById<T extends SupabaseObject> static method

Future<T> getById<T extends SupabaseObject>(
  1. String id, {
  2. List<String> selectedColumns = const ['*'],
})

Implementation

static Future<T> getById<T extends SupabaseObject>(
  String id, {
  List<String> selectedColumns = const ['*'],
}) async {
  try {
    return extractSupabaseSingleRow(
      await env.client
          .from(tableName(T))
          .select(selectedColumns.join(','))
          .eq('id', id)
          .single(),
    );
  } catch (error, stacktrace) {
    catchSupabaseException(error, stacktrace);
    rethrow;
  }
}