8000 Support for Functions · Issue #115 · supabase/postgres-meta · GitHub
[go: up one dir, main page]

Skip to content

Support for Functions #115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kiwicopple opened this issue Jun 14, 2021 · 3 comments
Closed

Support for Functions #115

kiwicopple opened this issue Jun 14, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@kiwicopple
Copy link
Member

Feature request

Is your feature request related to a problem? Please describe.

We should implement trigger support. This is something we will need to build into our Dashboard

Describe the solution you'd like

A clean wrapper around select * from pg_proc

@kiwicopple kiwicopple added the enhancement New feature or request label Jun 14, 2021
i-pip added a commit to i-pip/postgres-meta that referenced this issue Jun 19, 2021
i-pip added a commit to i-pip/postgres-meta that referenced this issue Jun 20, 2021
Currently only supports changing function name. Working on changing function name, extensions and
schema at once

supabase#115
@soedirgo
Copy link
Member
soedirgo commented Jun 21, 2021

What does the requirement look like right now? I think supporting receive and delete are low-hanging fruits, but info about parameters are trickier:

  • they can have optional names
  • they can have optional default values
  • they can be in, out, inout, variadic, table

Also, should this contain other kinds of "functions", i.e. aggregate functions, window functions, and procedures? DataGrip for example groups all this under "routines"—should we separate them or combine them under /routines?

@i-pip would love for you to chime in as well (and thanks again for the PR!). You might also find pg_proc useful for reference.

P.S. forgot to mention that functions with different parameters can have the same name, so turns out it's not enough to identify them by name + schema.

@kiwicopple
Copy link
Member Author

should this contain other kinds of "functions", i.e. aggregate functions, window functions, and procedures?

I don't think so for now. It's not important for our use-case (user defined functions).

info about parameters are trickier

Understood. The "MVP" for this is to allow a user to create a function, then update/delete it afterwards. So ideally it would need to support these parameters.

This will be required in conjunction with triggers since triggers usually call a "function returning a trigger" like this.

For additional context, Steve is working on a library which could call a faas from Postgres (like Lambda). The ideal use-case here would be to combine with a trigger.

@i-pip
Copy link
Contributor
i-pip commented Jun 21, 2021

Thanks for the invitation to chime in @soedirgo . In the create function I made no assumptions about how params are structured, they're simply a string array - this means that the details of whether they are in out inout variadic or table are left up to the user.

So a user could provide only the data types e.g. ["int", "int"], names e.g ["a int", "b integer"] or even whether it's an in or out ["a int", "out result int"]

I also made the assumption that procedures should likely be their own route like "/procedures"

I like the "/routines" idea - it doesn't even have to break current impl since it can aggregate existing routes

i-pip added a commit to i-pip/postgres-meta that referenced this issue Jul 14, 2021
@w3b6x9 w3b6x9 closed this as completed Jul 16, 2021
avallete pushed a commit that referenced this issue May 13, 2025
implements missing routes and (POST & DELETE)

#115
avallete pushed a commit that referenced this issue May 13, 2025
Currently only supports changing function name. Working on changing function name, extensions and
schema at once

#115
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants
0