pub struct PgConfig {
pub host: String,
pub port: u16,
pub database: String,
pub user: String,
pub auth: PgAuthMethod,
pub tls: PgTlsMode,
pub application_name: Option<String>,
pub ssh_tunnel: Option<SshTunnelRef>,
pub connect_timeout_secs: Option<u64>,
pub max_pool_size: Option<u32>,
pub idle_timeout_secs: Option<u64>,
pub min_idle_connections: Option<u32>,
}Fields§
§host: String§port: u16§database: String§user: String§auth: PgAuthMethod§tls: PgTlsMode§application_name: Option<String>Optional application_name reported to the server. Surfaces nicely in
pg_stat_activity so DBAs can identify connections from r-shell.
ssh_tunnel: Option<SshTunnelRef>Optional SSH tunnel. When Some, the connection is established to
127.0.0.1:<ephemeral> after the tunnel is spliced.
connect_timeout_secs: Option<u64>Connection timeout, seconds. None falls back to the driver default.
max_pool_size: Option<u32>Maximum number of connections this profile’s pool may open.
None keeps the built-in default. Tighten on managed-DB
providers with strict max_connections quotas.
idle_timeout_secs: Option<u64>How long an idle connection lingers before the eviction loop
closes it, in seconds. None keeps the built-in default.
Lower values are politer to providers that bill on connection
hours (RDS, Neon).
min_idle_connections: Option<u32>Minimum idle connections to keep alive even past
idle_timeout_secs. Some(0) lets a profile fully evacuate
during inactivity at the cost of a reconnect on next use.