Struct sqlx::any::AnyConnectOptions
source · pub struct AnyConnectOptions(_);
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
Implementations§
source§impl AnyConnectOptions
impl AnyConnectOptions
pub fn as_postgres(&self) -> Option<&PgConnectOptions>
pub fn as_postgres_mut(&mut self) -> Option<&mut PgConnectOptions>
source§impl AnyConnectOptions
impl AnyConnectOptions
pub fn as_mysql(&self) -> Option<&MySqlConnectOptions>
pub fn as_mysql_mut(&mut self) -> Option<&mut MySqlConnectOptions>
source§impl AnyConnectOptions
impl AnyConnectOptions
pub fn as_sqlite(&self) -> Option<&SqliteConnectOptions>
pub fn as_sqlite_mut(&mut self) -> Option<&mut SqliteConnectOptions>
source§impl AnyConnectOptions
impl AnyConnectOptions
pub fn as_mssql(&self) -> Option<&MssqlConnectOptions>
pub fn as_mssql_mut(&mut self) -> Option<&mut MssqlConnectOptions>
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 connect(
&self
) -> Pin<Box<dyn Future<Output = Result<AnyConnection, Error>> + Send, Global>>
fn connect( &self ) -> Pin<Box<dyn Future<Output = Result<AnyConnection, Error>> + Send, Global>>
Establish a new database connection with the options specified by
self
.source§fn log_statements(&mut self, level: LevelFilter) -> &mut AnyConnectOptions
fn log_statements(&mut self, level: LevelFilter) -> &mut AnyConnectOptions
Log executed statements with the specified
level
source§fn log_slow_statements(
&mut self,
level: LevelFilter,
duration: Duration
) -> &mut AnyConnectOptions
fn log_slow_statements( &mut self, level: LevelFilter, duration: Duration ) -> &mut AnyConnectOptions
Log executed statements with a duration above the specified
duration
at the specified level
.source§fn disable_statement_logging(&mut self) -> &mut Self
fn disable_statement_logging(&mut self) -> &mut Self
Entirely disables statement logging (both slow and regular).
source§impl Debug for AnyConnectOptions
impl Debug for AnyConnectOptions
source§impl From<MssqlConnectOptions> for AnyConnectOptions
impl From<MssqlConnectOptions> for AnyConnectOptions
source§fn from(options: MssqlConnectOptions) -> AnyConnectOptions
fn from(options: MssqlConnectOptions) -> AnyConnectOptions
Converts to this type from the input type.
source§impl From<MySqlConnectOptions> for AnyConnectOptions
impl From<MySqlConnectOptions> for AnyConnectOptions
source§fn from(options: MySqlConnectOptions) -> AnyConnectOptions
fn from(options: MySqlConnectOptions) -> AnyConnectOptions
Converts to this type from the input type.
source§impl From<PgConnectOptions> for AnyConnectOptions
impl From<PgConnectOptions> for AnyConnectOptions
source§fn from(options: PgConnectOptions) -> AnyConnectOptions
fn from(options: PgConnectOptions) -> AnyConnectOptions
Converts to this type from the input type.
source§impl From<SqliteConnectOptions> for AnyConnectOptions
impl From<SqliteConnectOptions> for AnyConnectOptions
source§fn from(options: SqliteConnectOptions) -> AnyConnectOptions
fn from(options: SqliteConnectOptions) -> AnyConnectOptions
Converts to this type from the input type.
source§impl FromStr for AnyConnectOptions
impl FromStr for AnyConnectOptions
source§impl TryFrom<AnyConnectOptions> for MssqlConnectOptions
impl TryFrom<AnyConnectOptions> for MssqlConnectOptions
source§fn try_from(
value: AnyConnectOptions
) -> Result<MssqlConnectOptions, <MssqlConnectOptions as TryFrom<AnyConnectOptions>>::Error>
fn try_from( value: AnyConnectOptions ) -> Result<MssqlConnectOptions, <MssqlConnectOptions as TryFrom<AnyConnectOptions>>::Error>
Performs the conversion.
source§impl TryFrom<AnyConnectOptions> for MySqlConnectOptions
impl TryFrom<AnyConnectOptions> for MySqlConnectOptions
source§fn try_from(
value: AnyConnectOptions
) -> Result<MySqlConnectOptions, <MySqlConnectOptions as TryFrom<AnyConnectOptions>>::Error>
fn try_from( value: AnyConnectOptions ) -> Result<MySqlConnectOptions, <MySqlConnectOptions as TryFrom<AnyConnectOptions>>::Error>
Performs the conversion.
source§impl TryFrom<AnyConnectOptions> for PgConnectOptions
impl TryFrom<AnyConnectOptions> for PgConnectOptions
source§fn try_from(
value: AnyConnectOptions
) -> Result<PgConnectOptions, <PgConnectOptions as TryFrom<AnyConnectOptions>>::Error>
fn try_from( value: AnyConnectOptions ) -> Result<PgConnectOptions, <PgConnectOptions as TryFrom<AnyConnectOptions>>::Error>
Performs the conversion.
source§impl TryFrom<AnyConnectOptions> for SqliteConnectOptions
impl TryFrom<AnyConnectOptions> for SqliteConnectOptions
source§fn try_from(
value: AnyConnectOptions
) -> Result<SqliteConnectOptions, <SqliteConnectOptions as TryFrom<AnyConnectOptions>>::Error>
fn try_from( value: AnyConnectOptions ) -> Result<SqliteConnectOptions, <SqliteConnectOptions as TryFrom<AnyConnectOptions>>::Error>
Performs the conversion.