Skip to content
1 change: 1 addition & 0 deletions packages/postgrest/lib/postgrest.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ library;

export 'src/postgrest.dart';
export 'src/postgrest_builder.dart';
export 'src/postgrest_typed_builder.dart';
export 'src/types.dart';
export 'package:http/http.dart' show RequestAbortedException;
17 changes: 17 additions & 0 deletions packages/postgrest/lib/src/postgrest.dart
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,23 @@ class PostgrestClient {
);
}

/// Perform a typed table operation.
///
/// Unlike [from], results are converted into the row type of [table]
/// instead of raw `Map<String, dynamic>` data, and filters are built from
/// [TableColumn]s, which makes them compile-time checked.
///
/// ```dart
/// final List<Book> books = await client
/// .table(Books.table)
/// .select()
/// .where(Books.id.gt(10));
/// ```
@experimental
PostgrestTypedQueryBuilder<Row> table<Row>(PostgrestTable<Row> table) {
return PostgrestTypedQueryBuilder(from(table.name), table);
}

/// Select a schema to query or perform an function (rpc) call.
///
/// The schema needs to be on the list of exposed schemas inside Supabase.
Expand Down
Loading
Loading