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.
create or replace function hello_world() returns text as $$
select 'Hello world';
$$ language sql;
The stored procedure call to be executed.
Parameters passed into the stored procedure call.
When set to `true`, `data` will not be returned. Useful if you only need the count.
When set to `true`, the function will be called with read-only access mode.
Count algorithm to use to count rows returned by the function. Only applicable for [set-returning functions](https://www.postgresql.org/docs/current/functions-srf.html). `"exact"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the hood. `"planned"`: Approximated but fast count algorithm. Uses the Postgres statistics under the hood. `"estimated"`: Uses exact count for low numbers and planned count for high numbers.
response = supabase.rpc("hello_world").execute()
response = supabase.rpc("echo", \{ "say": "đź‘‹" \}).execute()
response = supabase.rpc("add_one_each", \{"arr": [1, 2, 3]\}).execute()
response = supabase.rpc("list_stored_countries").eq("id", 1).single().execute()
response = supabase.rpc('hello_world', get=True).execute()