-
Notifications
You must be signed in to change notification settings - Fork 874
Labels
Description
Given a NpgsqlConnection that's already configured, we used to be able to create a new connection from it by calling CloneWith, or casting it to ICloneable then calling Clone.
However it's not possible to do this with LogicalReplicationConnection, since its only way of configuration is passing a connection string, leaving us having to enable Persist Security Info=true.
I would suggest introducing a copy constructor to solve this:
public ReplicationConnection(NpgsqlConnection connection) { /*...*/ }
public LogicalReplicationConnection(NpgsqlConnection connection) { /*...*/ }Further technical details
Npgsql version: latest (v9)
npgsql/src/Npgsql/Replication/LogicalReplicationConnection.cs
Lines 10 to 19 in 2b013ed
| /// <summary> | |
| /// Initializes a new instance of <see cref="LogicalReplicationConnection"/>. | |
| /// </summary> | |
| public LogicalReplicationConnection() {} | |
| /// <summary> | |
| /// Initializes a new instance of <see cref="LogicalReplicationConnection"/> with the given connection string. | |
| /// </summary> | |
| /// <param name="connectionString">The connection used to open the PostgreSQL database.</param> | |
| public LogicalReplicationConnection(string? connectionString) : base(connectionString) {} |
Reactions are currently unavailable