Are Functions and Stored Procedures the same thing...
# help
m
Are Functions and Stored Procedures the same thing?
n
Hello @Muezz! This thread has been automatically created from your message in #843999948717555735 a ``few seconds ago``. Pinging @User so that they see this as well! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ... menu) and select Leave Thread to unsubscribe from future updates. Want to change the title? Use the
/title
command! We have solved your problem? Click the button below to archive it.
s
Are you referring to database functions or cloud functions?
n
wubba_lubba_whatever (2022-04-08)
This
s
In this case yes they are the same thing
m
Then why do they appear separately in the documentation and show two very different way of invoking or calling each of them?
s
This is why I asked you which functions are you referring to, the doc is showing cloud functions (
invoke()
) doc and database functions separately (
rpc()
)
m
I see that but I am mainly confused because Supabase console does not call it Stored Procedures.
This image is from the
database
tab
s
Which would be correct when you compare it with the docs, but I can see where there can be confusion.
There is a top level Functions area in the dashbaord
Which would relate to the docs Functions top level menu
I just had a look at the docs and it does mention Edge Functions in the
invoke
docs
m
Top level Functions option in Dashboard -> Top level function in docs Triggers in database option in Dashboard -> You can decide here what function (or Stored Procedure too ig???) will run for any trigger Functions in database option in Dashboard -> You can define Stored Procedures here??? Function Hooks is database option in Dashboard -> No idea what these are at the moment
Can you tell me if any of these statements is wrong?
s
All correct
m
And what language do the top level functions use? In Firebase, you could either use JS or TS.
s
Function Hooks is what you can use to send requests outside of Supabase (think external API), later in the year you will be able to hook these up to Edge Functions.
This is a deno environment so the language will be JS or TS too
m
Okay cool. One more thing. I know we have to write the Stored Procedures in pure PostgreSQL and PostgreSQL has a SUM() function built into it to calculate sum of values. I cant see that in the intellisense of the SQL editor.
s
The intellisense might not have all the SQL functions available, but it will work when you run the code.
m
okay great