◐ Shell
clean mode source ↗

Add NpgsqlDataSource constructor to ReplicationConnection by Copilot · Pull Request #6527 · npgsql/npgsql

Copilot AI linked an issue

Apr 4, 2026

that may be closed by this pull request

Add new constructors to LogicalReplicationConnection, PhysicalReplicationConnection,
and the base ReplicationConnection class that accept an NpgsqlDataSource parameter.
This allows using data source features like UsePeriodicPasswordProvider with
replication connections.

When created from a data source, an internal UnpooledDataSource is created with
the data source's configuration but with replication-specific settings (Pooling=false,
Enlist=false, KeepAlive=0, and the appropriate ReplicationMode).

The ConnectionString setter throws InvalidOperationException when the connection
was created with a data source, consistent with NpgsqlConnection behavior.

Fixes #4392

Agent-Logs-Url: https://github.com/npgsql/npgsql/sessions/2cf5ecb4-b7ee-446f-9ff1-b083c127e961

Co-authored-by: roji <1862641+roji@users.noreply.github.com>

Copilot AI changed the title [WIP] Integrate ReplicationConnection with NpgsqlDataSource Add NpgsqlDataSource constructor to ReplicationConnection

Apr 4, 2026