add: configs as json GUC for db-root-spec - #5155
Conversation
These are needed for a complete OpenAPI spec
steve-chavez
left a comment
There was a problem hiding this comment.
Approving but let's wait for @wolfgangwalther and @mkleczek to see if they have any concerns.
|
I'll assume Michal's concerns in #5085 (comment) have not changed, since the PR's content has not changed. My concerns were raised in #3029 (comment). |
|
@wolfgangwalther I guess then you're suggesting to throwaway unnamed parameter support from the root spec and special case it? As commented on #5085 (comment) |
No, I'm suggesting the magic named argument support added to all RPCs, including the root endpoint. We have discussed this at some point somewhere, but I don't know how to find it quickly. IIRC, the gist was:
That means if your root endpoint function needs to know the value of |
|
Yeah that wasn't mentioned anywhere on #3029. Having it handy would have saved me a loot of time/effort 😿
Sounds like there's some consistency to it but what would be the benefit for all non-root endpoint RPCs? We already have the
A simplification would be just a Also I guess now that we didn't decide to merge it for v16, maybe we should prefer to solve #4863 (comment); with that we could avoid the need to pass configs and we don't have to change anything here. |
I think the original proposal was focused on the RPCs can then just take a shortcut here by naming these arguments themselves. TLDR: This is supposed to replace the GUC stuff eventually. |
It won't work for table endpoints as I've mentioned before, I've seen this type of use cases in the wild: create trigger ..
before insert on my_table
for each row
when (current_setting('request.method', true) = 'POST')
execute function ..;Edit: overall GUCs are one of our strongest/stable parts, I don't see a reason to discuss moving away from them now when there are so many other issues. |
That's why I mentioned that users can use arguments in pre-request and set their GUCs in there. Then it will work the same way.
Well, this was just in response to "why is this useful for RPCs?". We don't need to discuss this for RPCs - but no matter what, the named argument interface is much better for the root endpoint. |
Reopened #5085. Closes #3029.