Skip to main content
Version: v0

stream()

Notifies of data at the queried table.

supabase
.from('countries')
.stream(['id'])
.execute();

Notes

  • stream() will emit the initial data as well as any further change on the database as Stream of List<Map<String, dynamic>> by combining Postgrest and Realtime.
  • Takes a list of primary key columns as its argument.

Examples

Listening to a specific table

supabase
.from('countries')
.stream(['id'])
.execute();

Listening to a specific rows within a table

You can listen to individual rows using the format {table}:{col}=eq.{val} - where {col} is the column name, and {val} is the value which you want to match. This syntax is the as how you can filter data in Realtime

supabase
.from('countries:id=eq.120')
.stream(['id'])
.execute();

With order()

supabase
.from('countries')
.stream(['id'])
.order('name', ascending: false)
.execute();

With limit()

supabase
.from('countries')
.stream(['id'])
.order('name', ascending: false)
.limit(10)
.execute();