Flutter: Match the filter

Match only rows which satisfy the filter. This is an escape hatch - you should use the specific filter methods wherever possible.

.filter() expects you to use the raw PostgREST syntax for the filter names and values, so it should only be used as an escape hatch in case other filters don't work.

.filter('arraycol','cs','\{"a","b"\}') // Use Postgres array \{\} and 'cs' for contains.
.filter('rangecol','cs','(1,2]') // Use Postgres range syntax for range column.
.filter('id','in','(6,7)')  // Use Postgres list () and 'in' for in_ filter.
.filter('id','cs','\{$\{mylist.join(',')\}\}')  // You can insert a Dart array list.

Parameters

Examples

With `select()`

final data = await supabase
  .from('countries')
  .select()
  .filter('name', 'in', '("Algeria","Japan")')

With `update()`

final data = await supabase
  .from('cities')
  .update(\{ 'name': 'Mordor' \})
  .filter('name', 'in', '("Paris","Tokyo")');

With `delete()`

final data = await supabase
  .from('cities')
  .delete()
  .filter('name', 'in', '("Paris","Tokyo")');

With `rpc()`

// Only valid if the Stored Procedure returns a table type.
final data = await supabase
  .rpc('echo_all_cities')
  .filter('name', 'in', '("Paris","Tokyo")');

On a referenced table

final data = await supabase
  .from('countries')
  .select('''
    name,
    cities!inner (
      name
    )
  ''')
  .filter('cities.name', 'eq', 'Bali')