Struct sea_orm::ConnectOptions
source · [−]pub struct ConnectOptions { /* private fields */ }
Expand description
Defines the configuration options of a database
Implementations
sourceimpl ConnectOptions
impl ConnectOptions
sourcepub fn new(url: String) -> Self
pub fn new(url: String) -> Self
Create new ConnectOptions for a Database by passing in a URI string
sourcepub fn pool_options<DB>(self) -> PoolOptions<DB> where
DB: Database,
pub fn pool_options<DB>(self) -> PoolOptions<DB> where
DB: Database,
Convert ConnectOptions into [sqlx::pool::PoolOptions]
sourcepub fn max_connections(&mut self, value: u32) -> &mut Self
pub fn max_connections(&mut self, value: u32) -> &mut Self
Set the maximum number of connections of the pool
sourcepub fn get_max_connections(&self) -> Option<u32>
pub fn get_max_connections(&self) -> Option<u32>
Get the maximum number of connections of the pool, if set
sourcepub fn min_connections(&mut self, value: u32) -> &mut Self
pub fn min_connections(&mut self, value: u32) -> &mut Self
Set the minimum number of connections of the pool
sourcepub fn get_min_connections(&self) -> Option<u32>
pub fn get_min_connections(&self) -> Option<u32>
Get the minimum number of connections of the pool, if set
sourcepub fn connect_timeout(&mut self, value: Duration) -> &mut Self
pub fn connect_timeout(&mut self, value: Duration) -> &mut Self
Set the timeout duration when acquiring a connection
sourcepub fn get_connect_timeout(&self) -> Option<Duration>
pub fn get_connect_timeout(&self) -> Option<Duration>
Get the timeout duration when acquiring a connection, if set
sourcepub fn idle_timeout(&mut self, value: Duration) -> &mut Self
pub fn idle_timeout(&mut self, value: Duration) -> &mut Self
Set the idle duration before closing a connection
sourcepub fn get_idle_timeout(&self) -> Option<Duration>
pub fn get_idle_timeout(&self) -> Option<Duration>
Get the idle duration before closing a connection, if set
sourcepub fn max_lifetime(&mut self, lifetime: Duration) -> &mut Self
pub fn max_lifetime(&mut self, lifetime: Duration) -> &mut Self
Set the maximum lifetime of individual connections
sourcepub fn get_max_lifetime(&self) -> Option<Duration>
pub fn get_max_lifetime(&self) -> Option<Duration>
Get the maximum lifetime of individual connections, if set
sourcepub fn sqlx_logging(&mut self, value: bool) -> &mut Self
pub fn sqlx_logging(&mut self, value: bool) -> &mut Self
Enable SQLx statement logging (default true)
sourcepub fn get_sqlx_logging(&self) -> bool
pub fn get_sqlx_logging(&self) -> bool
Get whether SQLx statement logging is enabled
Trait Implementations
sourceimpl Debug for ConnectOptions
impl Debug for ConnectOptions
sourceimpl From<&'_ String> for ConnectOptions
impl From<&'_ String> for ConnectOptions
sourcefn from(string: &String) -> ConnectOptions
fn from(string: &String) -> ConnectOptions
Performs the conversion.
sourceimpl From<&'_ str> for ConnectOptions
impl From<&'_ str> for ConnectOptions
sourcefn from(string: &str) -> ConnectOptions
fn from(string: &str) -> ConnectOptions
Performs the conversion.
sourceimpl From<String> for ConnectOptions
impl From<String> for ConnectOptions
sourcefn from(string: String) -> ConnectOptions
fn from(string: String) -> ConnectOptions
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for ConnectOptions
impl Send for ConnectOptions
impl Sync for ConnectOptions
impl Unpin for ConnectOptions
impl UnwindSafe for ConnectOptions
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more