-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Make PgTypeInfo publicly-constructible to support custom types #58
Comments
After some internal discussion we've decided to add something like: PgTypeInfo::with_name("dsflsdjfl")
PgTypeInfo::with_oid(201012)
|
So the Or will |
In short, no. It'll probably internally be an
|
|
Ah, that makes sense. Thanks for all the details. Would you be interested in a PR? |
Adding Keep in mind that the reason that we want to support types by name is that the type OID isn't going to be stable across databases for custom types, if stuff got added in a different order or it's a newer version with more types. However, OIDs should be sufficient for tinkering with custom types against a single database. |
Added |
In PostgreSQL, custom types can be created with
CREATE TYPE
(e.g. enums). To interface with such types usingsqlx
, one would have to (amongst other things) implementHasSqlType<CustomType> for Postgres
, which in turn requires being able to construct aPgTypeInfo
.PgTypeInfo
currently doesn't have a public constructor or all-public fields though.The text was updated successfully, but these errors were encountered: