pub struct DatabaseConfig {
pub url: Option<String>,
pub host: Option<String>,
pub port: Option<u16>,
pub user: Option<String>,
pub password: Option<String>,
pub database: Option<String>,
pub connect_retries: u32,
pub ssl_mode: SslMode,
pub connect_timeout_secs: u32,
pub statement_timeout_secs: u32,
pub keepalive_secs: u32,
}Expand description
Database connection configuration.
Fields§
§url: Option<String>Full connection URL (e.g., postgres://user:pass@host/db).
host: Option<String>Database server hostname.
port: Option<u16>Database server port number.
user: Option<String>Database user for authentication.
password: Option<String>Database password for authentication.
database: Option<String>Database name to connect to.
connect_retries: u32Number of times to retry a failed connection (max 20).
ssl_mode: SslModeSSL/TLS mode for the database connection.
connect_timeout_secs: u32Connection timeout in seconds.
statement_timeout_secs: u32Statement timeout in seconds (0 means no timeout).
keepalive_secs: u32TCP keepalive interval in seconds (0 disables, default 120).
Trait Implementations§
Source§impl Clone for DatabaseConfig
impl Clone for DatabaseConfig
Source§fn clone(&self) -> DatabaseConfig
fn clone(&self) -> DatabaseConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DatabaseConfig
impl Debug for DatabaseConfig
Auto Trait Implementations§
impl Freeze for DatabaseConfig
impl RefUnwindSafe for DatabaseConfig
impl Send for DatabaseConfig
impl Sync for DatabaseConfig
impl Unpin for DatabaseConfig
impl UnsafeUnpin for DatabaseConfig
impl UnwindSafe for DatabaseConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more