-
Notifications
You must be signed in to change notification settings - Fork 877
Remove BuiltInPostgresType attribute reflection #5375
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
Conversation
750aaa3 to
7a68fd6
Compare
|
Folding all data into the MinimalDatabaseInfo reduces our binary size by a small amount (4kb) and reduces our reliance on reflection, probably worth it. |
7a68fd6 to
07a3fd5
Compare
roji
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty straightforward, thanks!
In the future, we can consider making PgMinimalDatabaseInfo a programmatic opt-in, rather than the current connection string. This would allow it to get trimmed if not used, and goes in the direction of at least moving non-environmental options out of the connection string.
| @@ -0,0 +1,21 @@ | |||
| namespace Npgsql.PostgresTypes; | |||
|
|
|||
| enum PostgresTypeKind | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally prefer to keep the PgTypeKind naming for the succinctness.. I'd actually consider going in the other direction and rename other types prefixed with Postgres to Pg (e.g. PgMinimalDatabaseInfo)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I renamed it to fit in with the other Postgres* types in here. I agree Pg is nice and succinct but we can't rename the others (since they're public) so I went with Postgres for consistency.
We can try but we're using it unconditionally as a bootstrap type catalog to go from datatypenames in the resolvers to pgtypeid oids. I think we'll always need such a minimal map available. |
07a3fd5 to
e4ecf91
Compare
Some work that I didn't want to put into #5123
Related to #4949.
Though not because of as reflection free mode is essentially unsupported.
It would expand our minimal set slightly too as previously we didn't import range array types or multirange array types, they weren't specified.