MsSqlConnection

Struct MsSqlConnection 

pub struct MsSqlConnection { /* private fields */ }

Implementations§

§

impl MsSqlConnection

pub async fn execute<'a>( &mut self, query: MsSqlQuery<'a>, ) -> Result<Vec<u64>, Error>

pub async fn fetch_many<'a, 'b>( &'b mut self, query: MsSqlQuery<'a>, ) -> Result<MapErr<QueryStream<'b>, fn(SrcErr) -> Error>, Error>

pub async fn execute_batch( &mut self, sql: &str, ) -> Result<MsSqlExecuteResult, Error>

Execute a raw SQL batch using the SQLBatch TDS packet (not sp_executesql).

Unlike [execute], this sends the SQL as a raw batch request, which means:

  • Temp tables created here are visible to subsequent queries on the same connection.
  • Multi-statement batches separated by semicolons are sent as one unit.

Use this instead of [execute] whenever temp table visibility is required.

Trait Implementations§

§

impl Connection for MsSqlConnection

§

type Database = MsSql

§

type Options = MsSqlConnectOptions

§

fn close(self) -> BoxFuture<'static, Result<(), Error>>

Explicitly close this database connection. Read more
§

fn close_hard(self) -> BoxFuture<'static, Result<(), Error>>

Immediately close the connection without sending a graceful shutdown. Read more
§

fn ping(&mut self) -> BoxFuture<'_, Result<(), Error>>

Checks if a connection to the database is still valid.
§

fn begin( &mut self, ) -> BoxFuture<'_, Result<Transaction<'_, Self::Database>, Error>>
where Self: Sized,

Begin a new transaction or establish a savepoint within the active transaction. Read more
§

fn transaction<'a, F, R, E>( &'a mut self, callback: F, ) -> BoxFuture<'a, Result<R, E>>
where for<'c> F: FnOnce(&'c mut Transaction<'_, Self::Database>) -> BoxFuture<'c, Result<R, E>> + 'a + Send + Sync, Self: Sized, R: Send, E: From<Error> + Send,

Execute the function inside a transaction. Read more
§

fn connect(url: &str) -> BoxFuture<'static, Result<Self, Error>>
where Self: Sized,

Establish a new database connection. Read more
§

fn connect_with(options: &Self::Options) -> BoxFuture<'_, Result<Self, Error>>
where Self: Sized,

Establish a new database connection with the provided options.

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, 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<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more