-
-
Notifications
You must be signed in to change notification settings - Fork 255
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
"Records like structs" #1458
Comments
For cases where the fields use characters that aren't acceptable in Rust identifiers, or the type has such a name, I think the style where you offer |
The main problem with this is that composite types can be dynamically redefined at runtime, adding or subtracting fields. However, that doesn't particularly seem like a meaningful concern for composite types that are defined by the extension itself, as then the logical expectation is that if you redefine something in the extension, you rebuild the extension. Trying to have an implementation that unites both the "external" composite type and the "internal" composite type cases seamlessly, when those are significantly different to actually interact with, is slightly problematic. |
( obviously we should panic if we can't satisfy the deserialization request anymore. ) |
So, unless something changed in Postgres 16 or Postgres 17, composite types can be changed at runtime but it's a pain in the ass to do because Postgres will issue an error if the composite type is actually used as a column anywhere (since that requires rebuilding the column, basically). |
If I'm going to suffer through the implementation of so many accursed macros, then implementing returning a composite type should be as simple as
This much pain and effort to create a sound library is only worth it if the results are
PURE
MAGIC.
Allowing grodier, "lower-level" handling also is fine, too, but that should be the default.
The text was updated successfully, but these errors were encountered: