Flutter: 调用Postgres函数

执行函数调用。

您可以将Postgres函数作为远程过程调用,这是可以在任何位置执行的数据库逻辑。 当逻辑很少变化时(如密码重置和更新),函数非常有用。

Parameters

Examples

调用无参数的 Postgres 函数

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

调用带参数的 Postgres 函数

final data = await supabase
  .rpc('echo_city', params: { 'say': '👋' });

批量处理

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

调用带过滤条件的Postgres函数

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