I’m trying to get this simple script to work but there’s nothing returned. RLS has been disabled the and function has been tested on command line via the Supabase REST interface.
Can someone please help. I have been stuck for days.
@hongchuan - I believe the parameter is a JSON and the property name(s) needs to be passed
for example if your function in supabase is “FUNCTION get_active_customers(ndays int)” then rpc(‘get_active_customers’, { ndays:p_days }); assuming p_days is your var
Yes, that’s the issue, not specifying the param name. I still can’t wrap my head around why instead of using REST someone would use RPC from the SDK instance for something this trivial. I’d say the instance is big guns, where as calling a function is fairly simply done with REST too.
Check out if you have any RLS, and if the function works. Might be an error in the setup also. I think if you try to remove the result.key, that might give you a different response actually.