Struct sqlx_oldapi::mssql::MssqlConnectOptions
source ยท pub struct MssqlConnectOptions { /* private fields */ }
Available on crate feature
mssql
only.Expand description
Options and flags which can be used to configure a Microsoft SQL Server connection.
Connection strings should be in the form:
mssql://[username[:password]@]host/database[?instance=instance_name&packet_size=packet_size&client_program_version=client_program_version&client_pid=client_pid&hostname=hostname&app_name=app_name&server_name=server_name&client_interface_name=client_interface_name&language=language]
Implementationsยง
sourceยงimpl MssqlConnectOptions
impl MssqlConnectOptions
pub fn new() -> MssqlConnectOptions
pub fn host(self, host: &str) -> MssqlConnectOptions
pub fn port(self, port: u16) -> MssqlConnectOptions
pub fn username(self, username: &str) -> MssqlConnectOptions
pub fn password(self, password: &str) -> MssqlConnectOptions
pub fn database(self, database: &str) -> MssqlConnectOptions
pub fn instance(self, instance: &str) -> MssqlConnectOptions
pub fn client_program_version( self, client_program_version: u32 ) -> MssqlConnectOptions
pub fn client_pid(self, client_pid: u32) -> MssqlConnectOptions
pub fn hostname(self, hostname: &str) -> MssqlConnectOptions
pub fn app_name(self, app_name: &str) -> MssqlConnectOptions
pub fn server_name(self, server_name: &str) -> MssqlConnectOptions
pub fn client_interface_name( self, client_interface_name: &str ) -> MssqlConnectOptions
pub fn language(self, language: &str) -> MssqlConnectOptions
sourcepub fn requested_packet_size(
self,
size: u32
) -> Result<MssqlConnectOptions, MssqlConnectOptions>
pub fn requested_packet_size( self, size: u32 ) -> Result<MssqlConnectOptions, MssqlConnectOptions>
Size in bytes of TDS packets to exchange with the server. Returns an error if the size is smaller than 512 bytes
Trait Implementationsยง
sourceยงimpl Clone for MssqlConnectOptions
impl Clone for MssqlConnectOptions
sourceยงfn clone(&self) -> MssqlConnectOptions
fn clone(&self) -> MssqlConnectOptions
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 MssqlConnectOptions
impl ConnectOptions for MssqlConnectOptions
type Connection = MssqlConnection
sourceยงfn connect(
&self
) -> Pin<Box<dyn Future<Output = Result<<MssqlConnectOptions as ConnectOptions>::Connection, Error>> + Send + '_>>where
<MssqlConnectOptions as ConnectOptions>::Connection: Sized,
fn connect( &self ) -> Pin<Box<dyn Future<Output = Result<<MssqlConnectOptions as ConnectOptions>::Connection, Error>> + Send + '_>>where <MssqlConnectOptions as ConnectOptions>::Connection: Sized,
Establish a new database connection with the options specified by
self
.sourceยงfn log_statements(&mut self, level: LevelFilter) -> &mut MssqlConnectOptions
fn log_statements(&mut self, level: LevelFilter) -> &mut MssqlConnectOptions
Log executed statements with the specified
level
sourceยงfn log_slow_statements(
&mut self,
level: LevelFilter,
duration: Duration
) -> &mut MssqlConnectOptions
fn log_slow_statements( &mut self, level: LevelFilter, duration: Duration ) -> &mut MssqlConnectOptions
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 MssqlConnectOptions
impl Debug for MssqlConnectOptions
sourceยงimpl Default for MssqlConnectOptions
impl Default for MssqlConnectOptions
sourceยงfn default() -> MssqlConnectOptions
fn default() -> MssqlConnectOptions
Returns the โdefault valueโ for a type. Read more
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 FromStr for MssqlConnectOptions
impl FromStr for MssqlConnectOptions
sourceยงfn from_str(
s: &str
) -> Result<MssqlConnectOptions, <MssqlConnectOptions as FromStr>::Err>
fn from_str( s: &str ) -> Result<MssqlConnectOptions, <MssqlConnectOptions as FromStr>::Err>
Parse a connection string into a set of connection options.
The connection string is expected to be a valid URL with the following format:
mssql://[username[:password]@]host/database[?instance=instance_name&packet_size=packet_size&client_program_version=client_program_version&client_pid=client_pid&hostname=hostname&app_name=app_name&server_name=server_name&client_interface_name=client_interface_name&language=language]
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.
Auto Trait Implementationsยง
impl RefUnwindSafe for MssqlConnectOptions
impl Send for MssqlConnectOptions
impl Sync for MssqlConnectOptions
impl Unpin for MssqlConnectOptions
impl UnwindSafe for MssqlConnectOptions
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