pub struct OdbcConnectOptions { /* private fields */ }
odbc
only.Implementations§
Source§impl OdbcConnectOptions
impl OdbcConnectOptions
pub fn connection_string(&self) -> &str
Sourcepub fn buffer_settings(
&mut self,
settings: OdbcBufferSettings,
) -> &mut OdbcConnectOptions
pub fn buffer_settings( &mut self, settings: OdbcBufferSettings, ) -> &mut OdbcConnectOptions
Sets the buffer configuration for this connection.
The buffer settings control memory usage and performance characteristics when fetching data from ODBC data sources.
§Example
use std::str::FromStr;
use sqlx_core_oldapi::odbc::{OdbcConnectOptions, OdbcBufferSettings};
let mut opts = OdbcConnectOptions::from_str("DSN=MyDataSource")?;
// Configure for high-throughput buffered mode
opts.buffer_settings(OdbcBufferSettings {
batch_size: 256,
max_column_size: Some(2048),
});
// Or configure for unbuffered mode
opts.buffer_settings(OdbcBufferSettings {
batch_size: 128, // batch_size is ignored in unbuffered mode
max_column_size: None,
});
Sourcepub fn batch_size(&mut self, batch_size: usize) -> &mut OdbcConnectOptions
pub fn batch_size(&mut self, batch_size: usize) -> &mut OdbcConnectOptions
Sets the batch size for bulk fetch operations.
This controls how many rows are fetched at once during query execution.
Higher values can improve performance for large result sets but use more memory.
Only used when max_column_size
is Some(value)
(buffered mode).
§Panics
Panics if batch_size
is 0.
Sourcepub fn max_column_size(
&mut self,
max_column_size: Option<usize>,
) -> &mut OdbcConnectOptions
pub fn max_column_size( &mut self, max_column_size: Option<usize>, ) -> &mut OdbcConnectOptions
Sets the maximum column size for text and binary data.
This controls the buffer size allocated for columns when the database doesn’t specify a maximum length. Larger values ensure complete data capture but increase memory usage.
- When set to
Some(value)
: Enables buffered mode with batch fetching - When set to
None
: Enables unbuffered mode with row-by-row processing
§Panics
Panics if max_column_size
is less than 0.
Sourcepub fn buffer_settings_ref(&self) -> &OdbcBufferSettings
pub fn buffer_settings_ref(&self) -> &OdbcBufferSettings
Returns the current buffer settings for this connection.
Trait Implementations§
Source§impl Clone for OdbcConnectOptions
impl Clone for OdbcConnectOptions
Source§fn clone(&self) -> OdbcConnectOptions
fn clone(&self) -> OdbcConnectOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl ConnectOptions for OdbcConnectOptions
impl ConnectOptions for OdbcConnectOptions
type Connection = OdbcConnection
Source§fn connect(
&self,
) -> Pin<Box<dyn Future<Output = Result<<OdbcConnectOptions as ConnectOptions>::Connection, Error>> + Send + '_>>
fn connect( &self, ) -> Pin<Box<dyn Future<Output = Result<<OdbcConnectOptions as ConnectOptions>::Connection, Error>> + Send + '_>>
self
.Source§fn log_statements(&mut self, level: LevelFilter) -> &mut OdbcConnectOptions
fn log_statements(&mut self, level: LevelFilter) -> &mut OdbcConnectOptions
level
Source§fn log_slow_statements(
&mut self,
level: LevelFilter,
duration: Duration,
) -> &mut OdbcConnectOptions
fn log_slow_statements( &mut self, level: LevelFilter, duration: Duration, ) -> &mut OdbcConnectOptions
duration
at the specified level
.Source§fn disable_statement_logging(&mut self) -> &mut Self
fn disable_statement_logging(&mut self) -> &mut Self
Source§impl Debug for OdbcConnectOptions
impl Debug for OdbcConnectOptions
Source§impl From<OdbcConnectOptions> for AnyConnectOptions
impl From<OdbcConnectOptions> for AnyConnectOptions
Source§fn from(options: OdbcConnectOptions) -> AnyConnectOptions
fn from(options: OdbcConnectOptions) -> AnyConnectOptions
Source§impl FromStr for OdbcConnectOptions
impl FromStr for OdbcConnectOptions
Source§impl TryFrom<AnyConnectOptions> for OdbcConnectOptions
impl TryFrom<AnyConnectOptions> for OdbcConnectOptions
Source§fn try_from(
value: AnyConnectOptions,
) -> Result<OdbcConnectOptions, <OdbcConnectOptions as TryFrom<AnyConnectOptions>>::Error>
fn try_from( value: AnyConnectOptions, ) -> Result<OdbcConnectOptions, <OdbcConnectOptions as TryFrom<AnyConnectOptions>>::Error>
Auto Trait Implementations§
impl Freeze for OdbcConnectOptions
impl RefUnwindSafe for OdbcConnectOptions
impl Send for OdbcConnectOptions
impl Sync for OdbcConnectOptions
impl Unpin for OdbcConnectOptions
impl UnwindSafe for OdbcConnectOptions
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> 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