I recommend you add more info in a thread here if a JS question, or move to general/sql depending on what you are asking. SB functions these days is unclear. A Postgres function (maybe called by rpc)? An SB Edge function? Not clear if trigger means a Postgres trigger or just a call. Then how would you use a function without defining it?