Let's say I have an edge function called "hello-world".
Question 1
How can I rewrite the SQL example from the supabase documentation to trigger the edge function "hello-world" in sql (e.g. without the supabase GUI)?
create trigger "my_webhook" after insert
on "public"."my_table" for each row
execute function "supabase_functions"."http_request"(
'http://localhost:3000',
'POST',
'{"Content-Type":"application/json"}',
'{}',
'1000'
);
Question 2
If the edge function must read another rls secured database table, do I have to call the edge function with a postgres role? How would I implement that with the SQL webhook?
Simply add the the edge function url as https parameter and an Authorization header in the first paranthese: