table<Row, Insert, Update> method

  1. @experimental
PostgrestTypedQueryBuilder<Row, Insert, Update> table<Row, Insert, Update>(
  1. PostgrestTable<Row, Insert, Update> table, {
  2. PostgrestTableExecutor? executor,
})

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 PostgrestColumns, which makes them compile-time checked.

The request addresses the schema chosen with schema when this client was scoped with it, otherwise PostgrestTable.schema when the table carries one, and otherwise the schema of the client.

final List<Book> books = await client
    .table(Books.table)
    .select()
    .where(Books.id.gt(10));

The builder collects a PostgrestTableRequest and hands it to executor when awaited; without one the request is sent to PostgREST through this client by a PostgrestHttpTableExecutor.

Implementation

@experimental
PostgrestTypedQueryBuilder<Row, Insert, Update> table<Row, Insert, Update>(
  PostgrestTable<Row, Insert, Update> table, {
  PostgrestTableExecutor? executor,
}) {
  final schema = _schemaIsExplicit ? _schema : (table.schema ?? _schema);
  return PostgrestTypedQueryBuilder(
    table,
    executor: executor ?? PostgrestHttpTableExecutor(this),
    schema: schema,
  );
}