pub struct PoolConfig {
pub max_connections: Option<u32>,
pub min_connections: Option<u32>,
pub idle_timeout: Option<Duration>,
pub max_lifetime: Option<Duration>,
pub acquire_timeout: Option<Duration>,
}Expand description
Configuration options for the database connection pool.
All fields are optional; when None, the sqlx defaults are used.
§Example
use ferriorm_runtime::client::PoolConfig;
use std::time::Duration;
let config = PoolConfig {
max_connections: Some(20),
idle_timeout: Some(Duration::from_secs(300)),
..Default::default()
};Fields§
§max_connections: Option<u32>Maximum number of connections in the pool.
min_connections: Option<u32>Minimum number of connections to keep open at all times.
idle_timeout: Option<Duration>Maximum time a connection can sit idle before being closed.
max_lifetime: Option<Duration>Maximum lifetime of a connection before it is closed and replaced.
acquire_timeout: Option<Duration>Maximum time to wait when acquiring a connection from the pool.
Trait Implementations§
Source§impl Clone for PoolConfig
impl Clone for PoolConfig
Source§fn clone(&self) -> PoolConfig
fn clone(&self) -> PoolConfig
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 PoolConfig
impl Debug for PoolConfig
Source§impl Default for PoolConfig
impl Default for PoolConfig
Source§fn default() -> PoolConfig
fn default() -> PoolConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PoolConfig
impl RefUnwindSafe for PoolConfig
impl Send for PoolConfig
impl Sync for PoolConfig
impl Unpin for PoolConfig
impl UnsafeUnpin for PoolConfig
impl UnwindSafe for PoolConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more