-
Notifications
You must be signed in to change notification settings - Fork 256
Allow null connection string with ConfigureDataSource #3693
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
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.
Pull request overview
This PR enables the use of ConfigureDataSource() without providing a connection string, allowing users to configure the connection details entirely through the NpgsqlDataSourceBuilder's connection string builder.
- Removed the null connection string guard that previously prevented creating a data source without an explicit connection string
- Added null coalescing to treat null connection strings as empty strings for dictionary key lookups
- Added a test case verifying the new functionality with a null connection string
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/EFCore.PG/Storage/Internal/NpgsqlDataSourceManager.cs | Removed null connection string guard and added null coalescing logic to support ConfigureDataSource without explicit connection string |
| test/EFCore.PG.Tests/NpgsqlRelationalConnectionTest.cs | Added test case for null connection string scenario and updated ConfigurableContext to accept nullable connection string |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Backported to 9.0.5 via 4f9503f |
Fixes #3692