Flutter: Call a Postgres function

Perform a function call.

You can call Postgres functions as Remote Procedure Calls, logic in your database that you can execute from anywhere. Functions are useful when the logic rarely changes—like for password resets and updates.

Parameters

Examples

Call a Postgres function without arguments

final data = await supabase
  .rpc('hello_world');

Call a Postgres function with arguments

final data = await supabase
  .rpc('echo_city', params: \{ 'say': 'đź‘‹' \});

Bulk processing

final data = await supabase
  .rpc('add_one_each', params: \{ arr: [1, 2, 3] \});

Call a Postgres function with filters

final data = await supabase
  .rpc('list_stored_countries')
  .eq('id', 1)
  .single();