-
Generally it would be neat to use postgres functions inside queries and mutations. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
I mean using it in a query, not as default. |
Beta Was this translation helpful? Give feedback.
-
As such, this is not a mechanism that Hasura provides, but rather it's Postgres itself which accepts that string as valid input text for the purpose of constructing a timestamp value (along with various others). So unfortunately there's no existing place we could extend to provide similar support for using Postgres it seems doesn't let you overload the accepted textual input formats of a type, but it is possible to supply your own parsing function to custom types. So in theory you should be able to define your own uuid type which supports |
Beta Was this translation helpful? Give feedback.
As such, this is not a mechanism that Hasura provides, but rather it's Postgres itself which accepts that string as valid input text for the purpose of constructing a timestamp value (along with various others).
So unfortunately there's no existing place we could extend to provide similar support for using
gen_random_uuid()
for uuid columns.Postgres it seems doesn't let you overload the accepted textual input formats of a type, but it is possible to supply your own parsing function to custom types.
So in theory you should be able to define your own uuid type which supports
gen_random_uuid
in addition to literal uuids, although the practical value of doing this is questionable.