Struct sqlx_postgres::any::AnyConnectOptions
source · #[non_exhaustive]pub struct AnyConnectOptions {
pub database_url: Url,
pub log_settings: LogSettings,
}
Expand description
Opaque options for connecting to a database. These may only be constructed by parsing from a connection url.
postgres://postgres:password@localhost/database
mysql://root:password@localhost/database
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.database_url: Url
§log_settings: LogSettings
Trait Implementations§
source§impl Clone for AnyConnectOptions
impl Clone for AnyConnectOptions
source§fn clone(&self) -> AnyConnectOptions
fn clone(&self) -> AnyConnectOptions
Returns a copy 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 ConnectOptions for AnyConnectOptions
impl ConnectOptions for AnyConnectOptions
type Connection = AnyConnection
source§fn from_url(url: &Url) -> Result<AnyConnectOptions, Error>
fn from_url(url: &Url) -> Result<AnyConnectOptions, Error>
Parse the
ConnectOptions
from a URL.source§fn connect(
&self
) -> Pin<Box<dyn Future<Output = Result<AnyConnection, Error>> + Send + '_>>
fn connect( &self ) -> Pin<Box<dyn Future<Output = Result<AnyConnection, Error>> + Send + '_>>
Establish a new database connection with the options specified by
self
.source§fn log_statements(self, level: LevelFilter) -> AnyConnectOptions
fn log_statements(self, level: LevelFilter) -> AnyConnectOptions
Log executed statements with the specified
level
source§fn log_slow_statements(
self,
level: LevelFilter,
duration: Duration
) -> AnyConnectOptions
fn log_slow_statements( self, level: LevelFilter, duration: Duration ) -> AnyConnectOptions
Log executed statements with a duration above the specified
duration
at the specified level
.source§fn disable_statement_logging(self) -> Self
fn disable_statement_logging(self) -> Self
Entirely disables statement logging (both slow and regular).
source§impl Debug for AnyConnectOptions
impl Debug for AnyConnectOptions
source§impl FromStr for AnyConnectOptions
impl FromStr for AnyConnectOptions
source§impl<'a> TryFrom<&'a AnyConnectOptions> for PgConnectOptions
impl<'a> TryFrom<&'a AnyConnectOptions> for PgConnectOptions
Auto Trait Implementations§
impl RefUnwindSafe for AnyConnectOptions
impl Send for AnyConnectOptions
impl Sync for AnyConnectOptions
impl Unpin for AnyConnectOptions
impl UnwindSafe for AnyConnectOptions
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