OdbcConnectOptions

Struct OdbcConnectOptions 

Source
pub struct OdbcConnectOptions { /* private fields */ }
Available on crate feature odbc only.

Implementations§

Source§

impl OdbcConnectOptions

Source

pub fn connection_string(&self) -> &str

Source

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,
});
Source

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.

Source

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.

Source

pub fn buffer_settings_ref(&self) -> &OdbcBufferSettings

Returns the current buffer settings for this connection.

Trait Implementations§

Source§

impl Clone for OdbcConnectOptions

Source§

fn clone(&self) -> OdbcConnectOptions

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl ConnectOptions for OdbcConnectOptions

Source§

type Connection = OdbcConnection

Source§

fn connect( &self, ) -> Pin<Box<dyn Future<Output = Result<<OdbcConnectOptions as ConnectOptions>::Connection, Error>> + Send + '_>>

Establish a new database connection with the options specified by self.
Source§

fn log_statements(&mut self, level: LevelFilter) -> &mut OdbcConnectOptions

Log executed statements with the specified level
Source§

fn log_slow_statements( &mut self, level: LevelFilter, duration: Duration, ) -> &mut OdbcConnectOptions

Log executed statements with a duration above the specified duration at the specified level.
Source§

fn disable_statement_logging(&mut self) -> &mut Self

Entirely disables statement logging (both slow and regular).
Source§

impl Debug for OdbcConnectOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl From<OdbcConnectOptions> for AnyConnectOptions

Source§

fn from(options: OdbcConnectOptions) -> AnyConnectOptions

Converts to this type from the input type.
Source§

impl FromStr for OdbcConnectOptions

Source§

type Err = Error

The associated error which can be returned from parsing.
Source§

fn from_str( s: &str, ) -> Result<OdbcConnectOptions, <OdbcConnectOptions as FromStr>::Err>

Parses a string s to return a value of this type. Read more
Source§

impl TryFrom<AnyConnectOptions> for OdbcConnectOptions

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from( value: AnyConnectOptions, ) -> Result<OdbcConnectOptions, <OdbcConnectOptions as TryFrom<AnyConnectOptions>>::Error>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ErasedDestructor for T
where T: 'static,