postgresqlstored-proceduresrpcsupabase

Supabase: what's the difference between stored procedures, RPC's, database functions, etc


So I've got basic knowledge of database programming and I'm trying to set up my Supabase database to access it via a Flutter app. I'd like to do so using "Stored procedures" so all access is through well-defined functions.

Before diving too far I want to make sure I'm using the right methods, and I'm running into all sorts of nomenclature that may or may not be pointing to the same thing.

For what I'm trying to do I am seeing:

So my current conclusions, which I would like to confirm, are:

  1. Stored procedures, Postgres functions and Database functions are synonymous in this context? "Database functions" in particular feels ambiguous.

  2. RPC are a way of calling them externally

  3. Database triggers are a way of calling them automatically upon certain triggers

  4. Edge functions are a different animal (higher-level Typescript AWS Lambda-style more external-oriented functionality).

  5. "Supabase functions" are a bit ambiguous, but I believe refer to EDGE functions (?)


Solution

  • Yep, nailed it! Stored Procedures and Postgres Functions are synonymous. Edge Functions are a separate serverless function that run within Deno. RPC is the way you call Postgres Functions from the Supabase client 👍