pub struct MssqlConnection<S: AsyncRead + AsyncWrite + Unpin + Send = TokioConnectionStream> { /* private fields */ }Implementations§
Source§impl MssqlConnection<TokioConnectionStream>
impl MssqlConnection<TokioConnectionStream>
pub async fn connect(connection_string: &str) -> Result<Self, OrmError>
pub async fn connect_with_config( config: MssqlConnectionConfig, ) -> Result<Self, OrmError>
Source§impl<S: AsyncRead + AsyncWrite + Unpin + Send> MssqlConnection<S>
impl<S: AsyncRead + AsyncWrite + Unpin + Send> MssqlConnection<S>
pub fn new(client: Client<S>, config: MssqlConnectionConfig) -> Self
pub fn config(&self) -> &MssqlConnectionConfig
pub fn client(&self) -> &Client<S>
pub fn client_mut(&mut self) -> &mut Client<S>
pub async fn begin_transaction<'a>( &'a mut self, ) -> Result<MssqlTransaction<'a, S>, OrmError>
pub async fn begin_transaction_scope(&mut self) -> Result<(), OrmError>
pub async fn commit_transaction(&mut self) -> Result<(), OrmError>
pub async fn rollback_transaction(&mut self) -> Result<(), OrmError>
pub async fn health_check(&mut self) -> Result<(), OrmError>
pub fn into_inner(self) -> Client<S>
Source§impl<S> MssqlConnection<S>
impl<S> MssqlConnection<S>
pub async fn execute( &mut self, query: CompiledQuery, ) -> Result<ExecuteResult, OrmError>
pub async fn query_raw<'a>( &'a mut self, query: CompiledQuery, ) -> Result<QueryStream<'a>, OrmError>
pub async fn fetch_one<T>( &mut self, query: CompiledQuery, ) -> Result<Option<T>, OrmError>
pub async fn fetch_all<T>( &mut self, query: CompiledQuery, ) -> Result<Vec<T>, OrmError>
pub async fn fetch_one_with<T, F>( &mut self, query: CompiledQuery, map: F, ) -> Result<Option<T>, OrmError>
pub async fn fetch_all_with<T, F>( &mut self, query: CompiledQuery, map: F, ) -> Result<Vec<T>, OrmError>
Trait Implementations§
Source§impl<S> Executor for MssqlConnection<S>
impl<S> Executor for MssqlConnection<S>
fn execute<'life0, 'async_trait>(
&'life0 mut self,
query: CompiledQuery,
) -> Pin<Box<dyn Future<Output = Result<ExecuteResult, OrmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn fetch_one<'life0, 'async_trait, T>( &'life0 mut self, query: CompiledQuery, ) -> Pin<Box<dyn Future<Output = Result<Option<T>, OrmError>> + Send + 'async_trait>>
fn fetch_all<'life0, 'async_trait, T>( &'life0 mut self, query: CompiledQuery, ) -> Pin<Box<dyn Future<Output = Result<Vec<T>, OrmError>> + Send + 'async_trait>>
Auto Trait Implementations§
impl<S> Freeze for MssqlConnection<S>where
S: Freeze,
impl<S = Compat<TcpStream>> !RefUnwindSafe for MssqlConnection<S>
impl<S> Send for MssqlConnection<S>
impl<S> Sync for MssqlConnection<S>where
S: Sync,
impl<S> Unpin for MssqlConnection<S>
impl<S> UnsafeUnpin for MssqlConnection<S>where
S: UnsafeUnpin,
impl<S = Compat<TcpStream>> !UnwindSafe for MssqlConnection<S>
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