Struct MsSqlConnection
pub struct MsSqlConnection { /* private fields */ }Implementations§
§impl MsSqlConnection
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>
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
impl Connection for MsSqlConnection
type Database = MsSql
type Options = MsSqlConnectOptions
§fn close(self) -> BoxFuture<'static, Result<(), Error>>
fn close(self) -> BoxFuture<'static, Result<(), Error>>
Explicitly close this database connection. Read more
§fn close_hard(self) -> BoxFuture<'static, Result<(), Error>>
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>>
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,
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>>
fn transaction<'a, F, R, E>( &'a mut self, callback: F, ) -> BoxFuture<'a, Result<R, E>>
Execute the function inside a transaction. Read more
Auto Trait Implementations§
impl Freeze for MsSqlConnection
impl RefUnwindSafe for MsSqlConnection
impl Send for MsSqlConnection
impl Sync for MsSqlConnection
impl Unpin for MsSqlConnection
impl UnwindSafe for MsSqlConnection
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