Skip to content

Conversation

@roji
Copy link
Member

@roji roji commented Dec 23, 2025

Fixes #3692

Copilot AI review requested due to automatic review settings December 23, 2025 18:21
Copy link

Copilot AI left a 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.

Copilot AI review requested due to automatic review settings December 23, 2025 18:45
Copy link

Copilot AI left a 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.

Copilot AI review requested due to automatic review settings December 24, 2025 13:02
Copy link

Copilot AI left a 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.

@roji roji enabled auto-merge (squash) December 24, 2025 13:19
@roji roji disabled auto-merge December 24, 2025 13:34
@roji roji merged commit a64c405 into npgsql:main Dec 24, 2025
10 checks passed
@roji roji deleted the NullConnString branch December 24, 2025 13:35
roji added a commit that referenced this pull request Dec 24, 2025
@roji
Copy link
Member Author

roji commented Dec 24, 2025

Backported to 9.0.5 via 4f9503f

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.

ConfigureDataSource ignored when UseNpgsql without ConnectionString parameter used

1 participant