Skip to content
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

Register PG extensions in the model by convention #2161

Merged
merged 2 commits into from
Dec 30, 2021

Conversation

roji
Copy link
Member

@roji roji commented Dec 17, 2021

By scanning property types in the model.

@AndriySvyryd, this adds two ModelFinalizing conventions which scan all properties, get their type mappings, and for certain supported types that are known to require PostgreSQL extensions, adds those to the model. Up to now users have had to add these explicitly. Any intuition on whether this is problematic perf-wise?

Closes #2137

@roji roji force-pushed the PluginExtensionConventions branch 2 times, most recently from b032373 to b181606 Compare December 17, 2021 19:16
@AndriySvyryd
Copy link

Any reason not to add these extensions always? I assume there's a high chance they would be needed when the plugin is used.

@roji
Copy link
Member Author

roji commented Dec 20, 2021

For the NetTopologySuite plugin you're right - I'll do that at the minimum to avoid yet another pass over the model.

The problem is with the convention in the provider itself, for types which rare (hstore, ltree, lquery...); I definitely don't want to add those fringe extensions for everyone...

By scanning property types in the model.

Closes npgsql#2137
@AndriySvyryd
Copy link

Once dotnet/efcore#9329 is implemented this shouldn't be too bad perf-wise

@roji roji merged commit f6e9789 into npgsql:main Dec 30, 2021
@roji roji deleted the PluginExtensionConventions branch December 30, 2021 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider adding PostgreSQL extensions to the model by convention
2 participants