pub struct SqlxConfigBuilder { /* private fields */ }Expand description
Builder for SQLx configuration.
Implementations§
Source§impl SqlxConfigBuilder
impl SqlxConfigBuilder
Sourcepub fn max_connections(self, max: u32) -> Self
pub fn max_connections(self, max: u32) -> Self
Set max connections.
Sourcepub fn min_connections(self, min: u32) -> Self
pub fn min_connections(self, min: u32) -> Self
Set min connections.
Sourcepub fn connect_timeout(self, timeout: Duration) -> Self
pub fn connect_timeout(self, timeout: Duration) -> Self
Set connection timeout.
Sourcepub fn idle_timeout(self, timeout: Duration) -> Self
pub fn idle_timeout(self, timeout: Duration) -> Self
Set idle timeout.
Sourcepub fn no_idle_timeout(self) -> Self
pub fn no_idle_timeout(self) -> Self
Disable idle timeout.
Sourcepub fn max_lifetime(self, lifetime: Duration) -> Self
pub fn max_lifetime(self, lifetime: Duration) -> Self
Set max lifetime.
Sourcepub fn no_max_lifetime(self) -> Self
pub fn no_max_lifetime(self) -> Self
Disable max lifetime.
Sourcepub fn statement_cache(self, capacity: usize) -> Self
pub fn statement_cache(self, capacity: usize) -> Self
Set statement cache capacity.
Sourcepub fn require_ssl(self) -> Self
pub fn require_ssl(self) -> Self
Require SSL.
Sourcepub fn application_name(self, name: impl Into<String>) -> Self
pub fn application_name(self, name: impl Into<String>) -> Self
Set application name.
Sourcepub fn build(self) -> SqlxConfig
pub fn build(self) -> SqlxConfig
Build the configuration.
Auto Trait Implementations§
impl Freeze for SqlxConfigBuilder
impl RefUnwindSafe for SqlxConfigBuilder
impl Send for SqlxConfigBuilder
impl Sync for SqlxConfigBuilder
impl Unpin for SqlxConfigBuilder
impl UnwindSafe for SqlxConfigBuilder
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> 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