PostgrestPartialRow<Row> class final

A row of a select list, as returned by PostgrestTypedQueryBuilder.selectOnly and PostgrestTypedTransformBuilder.selectOnly.

Values are read through the entries of the list, so the entry's type types the read and an entry of another table does not compile:

final books = await client
    .table(Books.table)
    .selectOnly([
      Books.id,
      Books.title,
      Books.author.select([Authors.name]),
    ]);

for (final book in books) {
  final int id = book.read(Books.id);
  final String? authorName = book.read(Books.author)?.read(Authors.name);
}

supabase_typegen also generates an extension per table with a getter for every column, computed field and relation, so the same reads are book.id and book.author?.name.

Reading an entry the list did not ask for throws a StateError naming it, instead of the null cast a getter of the full row type would fail with.

Annotations
  • @experimental

Constructors

PostgrestPartialRow.fromJson(Map<String, dynamic> json, List<PostgrestSelectable<Row>> selections)
A row of selections decoded from json, such as a test fixture or a row of a selectOnly with the same selections that was stored.
factory

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
read<Output>(PostgrestReadable<Row, Output> entry) → Output
The value of entry in this row.
toJson() → Map<String, dynamic>
The row as decoded from the response.
toRow(PostgrestTable<Row, Object?, Object?> table) → Row
The row as the full Row of table, when the select list asked for every column with PostgrestTable.allColumns or the row is a whole embed.
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited