Skip to content
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

feat: add Paths Object for GET requests on RPC endpoints #42

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

laurenceisla
Copy link
Member

@laurenceisla laurenceisla commented Feb 9, 2024

Needs to take into consideration the following:

  • Add function arguments to parameters as query params.
  • Functions that return table types need to reference it in the responses.
  • The above functions should also reference the table columns as rowFilters. This will be implemented in /POST requests.
  • Functions that return setof can return 200 and 206 responses since it allows Ranges and Count.
  • Functions that return scalar only return 200 (even json/jsonb cols)
  • Functions that return composite types need to reference them (for both setof and scalar)

…llisions

References have only the table/composite type name when they belong to the `current_schema`.
If they do not, then the references have the form `<schema>.<name>`.
Affected references: Parameter Objects and Schema Objects.
@laurenceisla laurenceisla force-pushed the func-get-path branch 2 times, most recently from 81bddc9 to 6fc2b3a Compare September 23, 2024 14:47
* These Component Schemas are needed to build the Response Objects for functions.
* The functions returning composite types are not included since those Component Schemas are already built in another function.
* Specifies RPC arguments as query parameters, since they are needed for RPC GET requests.
* Since these arguments are different from row filters (e.g. `arg=val` not `arg=eq.val`) the original types can be used (except for objects or arrays).
* Adds media type responses for the different return types of functions (RETURNS TABLE, RETURNS <type>, INOUT/OUT arguments).
* The `application/json` media type returns `array` only when the function is `SET OF`.
* Adds "/rpc/<function_name>" endpoints for valid functions to the Paths Object.
* Valid functions are those that have no unnamed parameters or have a single unnamed parameter of type `json`,`jsonb`,`text`,`xml`. The rest are invalid.
* Only `RETURNS SET OF` functions can return `206` to a partial request.
* Common parameters such as `select`, `or`, etc. can be used when a function RETURNS TABLE, composite types or has INOUT/OUT parameters.
@laurenceisla laurenceisla marked this pull request as ready for review September 23, 2024 20:54
@laurenceisla laurenceisla changed the title Add functions to the /get path feat: add Paths Object for GET requests on RPC endpoints Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant