pub struct PgConfigBuilder { /* private fields */ }Expand description
Builder for PostgreSQL configuration.
Debug output redacts the password, also inside the URL.
Implementations§
Source§impl PgConfigBuilder
impl PgConfigBuilder
Sourcepub fn url(self, url: impl Into<String>) -> Self
pub fn url(self, url: impl Into<String>) -> Self
Set the database URL (parses all connection parameters).
Sourcepub fn ssl_root_cert(self, path: impl Into<PathBuf>) -> Self
pub fn ssl_root_cert(self, path: impl Into<PathBuf>) -> Self
Set a PEM bundle of root certificates to verify the server against,
replacing the Mozilla root store. Equivalent to the sslrootcert URL
parameter.
Sourcepub fn connect_timeout(self, timeout: Duration) -> Self
pub fn connect_timeout(self, timeout: Duration) -> Self
Set the connection timeout.
Sourcepub fn statement_timeout(self, timeout: Duration) -> Self
pub fn statement_timeout(self, timeout: Duration) -> Self
Set the statement timeout.
Sourcepub fn application_name(self, name: impl Into<String>) -> Self
pub fn application_name(self, name: impl Into<String>) -> Self
Set the application name.
Sourcepub fn keepalives(self, enabled: bool) -> Self
pub fn keepalives(self, enabled: bool) -> Self
Enable or disable TCP keepalives (see PgConfig::keepalives).
Sourcepub fn keepalives_idle(self, idle: Duration) -> Self
pub fn keepalives_idle(self, idle: Duration) -> Self
Set the idle time before the first TCP keepalive probe (see
PgConfig::keepalives_idle). Zero keeps the driver default.
Sourcepub fn keepalives_interval(self, interval: Duration) -> Self
pub fn keepalives_interval(self, interval: Duration) -> Self
Set the interval between TCP keepalive probes (see
PgConfig::keepalives_interval). Zero keeps the OS default.
Sourcepub fn keepalives_retries(self, retries: u32) -> Self
pub fn keepalives_retries(self, retries: u32) -> Self
Set the number of unanswered TCP keepalive probes before the
connection is dropped (see PgConfig::keepalives_retries). Zero
keeps the OS default.
Sourcepub fn tcp_user_timeout(self, timeout: Duration) -> Self
pub fn tcp_user_timeout(self, timeout: Duration) -> Self
Set TCP_USER_TIMEOUT (see PgConfig::tcp_user_timeout). Zero
keeps the OS default.