Support for JSON functions with mixed type/arity like json_build_object #151
Replies: 1 comment
-
We could think of something like that, yes. That makes sense. That said, I think it would be more like For instance:
As for the json_agg, that's another topic ! I suggest we discuss it on another thread 🙂 Sorry for the late reply. |
Beta Was this translation helpful? Give feedback.
-
First of all: I love 🎉 that this library exists, and want to use it super much :)
But, in my project, I use a bunch of JSON stuff. I tried adding
json_build_object
viadb.public.registerFunction
, but can't get it to work due to its variable arity and typing. I'm thinking, maybe the overload-checking ofregisterFunction
could be (optionally) inverted? E.g. instead of setting theargs
option, setting an option likeacceptArgs: (args) => boolean
? ..and then also passing the types along with the args when invoking the function somehow.Has this idea, or the JSON functions, been floated before? I could put it some work into a fork, if this proposal or something similar sounds reasonable?
(Another issue I'm running into, btw, is using
table.*
, which I use a lot as injson_agg(table.*)
.)Beta Was this translation helpful? Give feedback.
All reactions