Is it possible to call a stored function on a local supabase instance?

I’m working with a local supabase instance, and I’ve defined a stored function within it.

When trying to cal the stored function, I get an error stating the function cannot be found.

Here’s the error:

name: "Error"
stack: "Error: Could not find the function public.manage_organizations_initiatives(p_initiative_id, p_organization_ids, type) in the schema cache at Object.callPostgresFunction (https://cdn.weweb.io/components/f9ef41c3-1c53-4857-855b-f2f6a40b7186/564adc72-0a34-48bc-b0e3-2ba4fa54c214/dist/manager.js:1:223898) at async we (https://editor-cdn.weweb.io/ww_front/public/js/index.ca9030c0.js:1:466918) at async me (https://editor-cdn.weweb.io/ww_front/public/js/index.ca9030c0.js:1:451658) at async me (https://editor-cdn.weweb.io/ww_front/public/js/index.ca9030c0.js:1:452049) at async pe (https://editor-cdn.weweb.io/ww_front/public/js/index.ca9030c0.js:1:450173)"
message: "Could not find the function public.manage_organizations_initiatives(p_initiative_id, p_organization_ids, type) in the schema cache"

Two questions:

  • Is there something I need to do to update the schema cache?
  • Is this call going out to the web?

Do you have the local instance hooked to WeWeb? E.g is your url, and apikeys set up in WeWeb?

Yeah, everything is hooked up, at least I think it has been. I’ve been developing locally for a while now. All normal queries work (SELECT, UPDATE, INSERT, DELETE, etc.). This just started happening with stored functions.

In postgres it is very sensitive to function arguments. Make sure it’s the right name, args and evwrything. I’d try invoking a (testing) function without params, sometjing simple to check. You can also always try postman.

1 Like

Thanks @Broberto

I’ll give that a shot!

1 Like