pub struct MssqlConnectOptions { /* private fields */ }Expand description
Connection options for an MSSQL ODBC data source.
Implementations§
Source§impl MssqlConnectOptions
impl MssqlConnectOptions
Sourcepub fn connection_string(&self) -> &str
pub fn connection_string(&self) -> &str
Returns the normalized ODBC connection string.
Sourcepub fn buffer_settings(
&mut self,
settings: MssqlBufferSettings,
) -> &mut MssqlConnectOptions
pub fn buffer_settings( &mut self, settings: MssqlBufferSettings, ) -> &mut MssqlConnectOptions
Sets the buffer configuration for this connection.
Sourcepub fn buffer_settings_ref(&self) -> &MssqlBufferSettings
pub fn buffer_settings_ref(&self) -> &MssqlBufferSettings
Returns the current buffer settings.
Sourcepub fn batch_size(&mut self, batch_size: usize) -> &mut MssqlConnectOptions
pub fn batch_size(&mut self, batch_size: usize) -> &mut MssqlConnectOptions
Sets the number of rows fetched in each batch.
Sourcepub fn max_column_size(
&mut self,
max_column_size: Option<usize>,
) -> &mut MssqlConnectOptions
pub fn max_column_size( &mut self, max_column_size: Option<usize>, ) -> &mut MssqlConnectOptions
Sets the maximum buffered column size, or None for unbuffered fetching.
Sourcepub fn statement_cache_capacity(
&mut self,
capacity: usize,
) -> &mut MssqlConnectOptions
pub fn statement_cache_capacity( &mut self, capacity: usize, ) -> &mut MssqlConnectOptions
Sets the maximum number of prepared statements kept in this connection’s cache.
Sourcepub fn log_statements(&mut self, level: LevelFilter) -> &mut MssqlConnectOptions
pub fn log_statements(&mut self, level: LevelFilter) -> &mut MssqlConnectOptions
Sets regular statement logging level.
Sourcepub fn log_slow_statements(
&mut self,
level: LevelFilter,
duration: Duration,
) -> &mut MssqlConnectOptions
pub fn log_slow_statements( &mut self, level: LevelFilter, duration: Duration, ) -> &mut MssqlConnectOptions
Sets slow statement logging level and threshold.
Sourcepub fn encrypt(&mut self, enable: bool) -> &mut MssqlConnectOptions
pub fn encrypt(&mut self, enable: bool) -> &mut MssqlConnectOptions
Enables or disables TLS encryption for the connection.
When enabled, adds Encrypt=yes to the connection string.
Sourcepub fn trust_certificate(&mut self, enable: bool) -> &mut MssqlConnectOptions
pub fn trust_certificate(&mut self, enable: bool) -> &mut MssqlConnectOptions
Enables or disables server certificate validation.
When enabled alongside encrypt(true), adds TrustServerCertificate=yes
to the connection string. Useful for development environments with
self-signed certificates.
Sourcepub fn connect_blocking(&self) -> Result<MssqlConnection, MssqlError>
pub fn connect_blocking(&self) -> Result<MssqlConnection, MssqlError>
Opens a blocking MSSQL ODBC connection.
Trait Implementations§
Source§impl Clone for MssqlConnectOptions
impl Clone for MssqlConnectOptions
Source§fn clone(&self) -> MssqlConnectOptions
fn clone(&self) -> MssqlConnectOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl ConnectOptions for MssqlConnectOptions
impl ConnectOptions for MssqlConnectOptions
type Connection = MssqlConnection
Source§fn from_url(url: &Url) -> Result<MssqlConnectOptions, Error>
fn from_url(url: &Url) -> Result<MssqlConnectOptions, Error>
ConnectOptions from a URL.Source§async fn connect(
&self,
) -> Result<<MssqlConnectOptions as ConnectOptions>::Connection, Error>
async fn connect( &self, ) -> Result<<MssqlConnectOptions as ConnectOptions>::Connection, Error>
self.Source§fn log_statements(self, level: LevelFilter) -> MssqlConnectOptions
fn log_statements(self, level: LevelFilter) -> MssqlConnectOptions
levelSource§fn log_slow_statements(
self,
level: LevelFilter,
duration: Duration,
) -> MssqlConnectOptions
fn log_slow_statements( self, level: LevelFilter, duration: Duration, ) -> MssqlConnectOptions
duration
at the specified level.Source§fn to_url_lossy(&self) -> Url
fn to_url_lossy(&self) -> Url
ConnectOptions. Read moreSource§fn disable_statement_logging(self) -> Self
fn disable_statement_logging(self) -> Self
Source§impl Debug for MssqlConnectOptions
impl Debug for MssqlConnectOptions
Auto Trait Implementations§
impl Freeze for MssqlConnectOptions
impl RefUnwindSafe for MssqlConnectOptions
impl Send for MssqlConnectOptions
impl Sync for MssqlConnectOptions
impl Unpin for MssqlConnectOptions
impl UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more