Struct sqlx_core_oldapi::mssql::MssqlConnectOptions
source · pub struct MssqlConnectOptions { /* private fields */ }
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() -> Self
pub fn host(self, host: &str) -> Self
pub fn port(self, port: u16) -> Self
pub fn username(self, username: &str) -> Self
pub fn password(self, password: &str) -> Self
pub fn database(self, database: &str) -> Self
pub fn instance(self, instance: &str) -> Self
pub fn client_program_version(self, client_program_version: u32) -> Self
pub fn client_pid(self, client_pid: u32) -> Self
pub fn hostname(self, hostname: &str) -> Self
pub fn app_name(self, app_name: &str) -> Self
pub fn server_name(self, server_name: &str) -> Self
pub fn client_interface_name(self, client_interface_name: &str) -> Self
pub fn language(self, language: &str) -> Self
sourcepub fn requested_packet_size(self, size: u32) -> Result<Self, Self>
pub fn requested_packet_size(self, size: u32) -> Result<Self, Self>
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) -> BoxFuture<'_, Result<Self::Connection, Error>>where
Self::Connection: Sized,
fn connect(&self) -> BoxFuture<'_, Result<Self::Connection, Error>>where Self::Connection: Sized,
Establish a new database connection with the options specified by
self
.source§fn log_statements(&mut self, level: LevelFilter) -> &mut Self
fn log_statements(&mut self, level: LevelFilter) -> &mut Self
Log executed statements with the specified
level
source§fn log_slow_statements(
&mut self,
level: LevelFilter,
duration: Duration
) -> &mut Self
fn log_slow_statements( &mut self, level: LevelFilter, duration: Duration ) -> &mut Self
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§impl From<MssqlConnectOptions> for AnyConnectOptions
impl From<MssqlConnectOptions> for AnyConnectOptions
source§fn from(options: MssqlConnectOptions) -> Self
fn from(options: MssqlConnectOptions) -> Self
Converts to this type from the input type.
source§impl FromStr for MssqlConnectOptions
impl FromStr for MssqlConnectOptions
source§fn from_str(s: &str) -> Result<Self, Self::Err>
fn from_str(s: &str) -> Result<Self, Self::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]
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