pgcentralfoundation / pgrx

Build Postgres Extensions with Rust!
Other
3.42k stars 223 forks source link

`&dyn Composite` as arg/ret #1718

Open workingjubilee opened 1 month ago

workingjubilee commented 1 month ago

So... this might sound a bit weird, but, I think it's possible for there to be a trait that describes all composite types, that works kind of like PgHeapTuple does now, but also incorporates the ability to have "immediate access" fields in a known layout if you successfully .downcast_composite::<T>(), and people can ask for what essentially is a kind of Result<T, &dyn Composite> to their function.

This is a bigger change than I intend to implement immediately, however.