-
Notifications
You must be signed in to change notification settings - Fork 33
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
Support for custom (opaque) type #384
Comments
Perhaps we should try to make it easy to write crates that extend pgrx with other extension's types like that, or provide a way of automatically binding the custom types. In this specific case, we can try to make it easier for binary-compatible types with existing known types, though. |
Kinda my current thought process too. I think there's enough information in the |
Well, there are transformation functions that Postgres knows about, and presumably the one of "citext -> text" is basically a no-op, so perhaps we can ask Postgres to do it for us, invoking the transformation function to get a type PL/Rust already knows about? And then we push that into the usual It is possible this violates the intention of @anth0nyleung though, by exposing a repr of the type. |
Hmm. That’s a good thought, actually. Either the xform functions or perhaps through casts (maybe that’s a problem for another day tho). I think where I’m still a little unsure is how the user tells us which rust type they want the argument to be. For pgrx that’s probably doable with generics at compile time. For plrust I am not sure. We’d almost need some kind of plrust function where the args are passed as a struct and which has a get_arg() function. And that leaves me wondering how the user tells us to use that function style. |
Im probably lacking some background context, im curious
citext is just an example, i think generally we want to enable the support to any type. Im guessing there will be limitation and im interested to understand them. Part of this feature / enhancement request is also because we want to leverage and extend this to the custom type created from the apis we are providing in pg_tle https://github.com/aws/pg_tle/blob/main/docs/09_datatypes.md |
PL/Rust does not support non-builtin custom types.
it would be a nice feature if pl/rust function can accept or return them.
The text was updated successfully, but these errors were encountered: