[B4X] Supabase - The Open Source Firebase alternative
Supabase is an open source Firebase alternative. It provides all the backend services you need to build a product. Supabase uses Postgres database with real-time capabilities. Basically, supabase provides an interface to manage postgres database that you can use to create table and insert, edit...
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.
Full example with parameters:
Postgres function:
create or replace function echo(say text) returns text as $$
begin
return say;
end;
$$ language plpgsql;
B4X:
Dim CallFunction As Supabase_DatabaseRpc = xSupabase.Database.CallFunction
CallFunction.Rpc("echo")
CallFunction.Parameters(CreateMap("say":"Hello B4X"))
Wait For (CallFunction.Execute) Complete (RpcResult As SupabaseRpcResult)
If RpcResult.Error.Success Then
Log(RpcResult.Data)
End If
The return data comes back unformatted as it comes back from the api.
Supabase RPC guide and best practices
Explore how to effectively use Supabase RPCs for seamless database interactions and optimized queries.
www.restack.io