pub struct DatabaseConfigBuilder { /* private fields */ }Expand description
Builder for database configuration.
Implementations§
Source§impl DatabaseConfigBuilder
impl DatabaseConfigBuilder
Sourcepub fn url(self, url: impl Into<String>) -> Self
pub fn url(self, url: impl Into<String>) -> Self
Set the connection URL (overrides other connection settings).
Sourcepub fn connect_timeout(self, timeout: Duration) -> Self
pub fn connect_timeout(self, timeout: Duration) -> Self
Set connection timeout.
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 max_connections(self, n: u32) -> Self
pub fn max_connections(self, n: u32) -> Self
Set max connections.
Sourcepub fn min_connections(self, n: u32) -> Self
pub fn min_connections(self, n: u32) -> Self
Set min connections.
Sourcepub fn idle_timeout(self, timeout: Duration) -> Self
pub fn idle_timeout(self, timeout: Duration) -> Self
Set idle timeout.
Sourcepub fn max_lifetime(self, lifetime: Duration) -> Self
pub fn max_lifetime(self, lifetime: Duration) -> Self
Set max lifetime.
Sourcepub fn postgres_options<F>(self, f: F) -> Self
pub fn postgres_options<F>(self, f: F) -> Self
Configure PostgreSQL options.
Sourcepub fn mysql_options<F>(self, f: F) -> Self
pub fn mysql_options<F>(self, f: F) -> Self
Configure MySQL options.
Sourcepub fn sqlite_options<F>(self, f: F) -> Self
pub fn sqlite_options<F>(self, f: F) -> Self
Configure SQLite options.
Sourcepub fn build(self) -> ConnectionResult<DatabaseConfig>
pub fn build(self) -> ConnectionResult<DatabaseConfig>
Build the configuration.
Auto Trait Implementations§
impl Freeze for DatabaseConfigBuilder
impl RefUnwindSafe for DatabaseConfigBuilder
impl Send for DatabaseConfigBuilder
impl Sync for DatabaseConfigBuilder
impl Unpin for DatabaseConfigBuilder
impl UnwindSafe for DatabaseConfigBuilder
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more