added ServerConfigurationMapping
split up Abstractions so we have one type per file.
This commit is contained in:
parent
b7631ecdd0
commit
a5cb6ef7d4
13 changed files with 431 additions and 76 deletions
29
pgLabII.PgUtils/ConnectionStrings/ConnectionDescriptor.cs
Normal file
29
pgLabII.PgUtils/ConnectionStrings/ConnectionDescriptor.cs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
using Npgsql;
|
||||
|
||||
namespace pgLabII.PgUtils.ConnectionStrings;
|
||||
|
||||
/// <summary>
|
||||
/// Canonical, format-agnostic representation of a PostgreSQL connection.
|
||||
/// Keep minimal fields for broad interoperability; store extras in Properties.
|
||||
/// </summary>
|
||||
public sealed class ConnectionDescriptor
|
||||
{
|
||||
public string? Name { get; init; }
|
||||
|
||||
// Primary hosts (support multi-host). If empty, implies localhost default.
|
||||
public IReadOnlyList<HostEndpoint> Hosts { get; init; } = new List<HostEndpoint>();
|
||||
|
||||
public string? Database { get; init; }
|
||||
public string? Username { get; init; }
|
||||
public string? Password { get; init; }
|
||||
|
||||
public SslMode? SslMode { get; init; }
|
||||
|
||||
// Common optional fields
|
||||
public string? ApplicationName { get; init; }
|
||||
public int? TimeoutSeconds { get; init; } // connect_timeout
|
||||
|
||||
// Additional parameters preserved across conversions
|
||||
public IReadOnlyDictionary<string, string> Properties { get; init; } =
|
||||
new Dictionary<string, string>();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue