pub struct MySQLTransaction<'c> { /* private fields */ }Expand description
Transaction adaptor for MySQL/MariaDB.
Wraps a mysql_async::Transaction and implements the Transaction/Executor
behavior expected by the tank_core abstractions.
Implementations§
Source§impl<'c> MySQLTransaction<'c>
impl<'c> MySQLTransaction<'c>
pub async fn new(connection: &'c mut MySQLConnection) -> Result<Self>
Trait Implementations§
Source§impl<'c> Executor for MySQLTransaction<'c>
impl<'c> Executor for MySQLTransaction<'c>
Source§type Driver = MySQLDriver
type Driver = MySQLDriver
Associated driver.
Source§fn accepts_multiple_statements(&self) -> bool
fn accepts_multiple_statements(&self) -> bool
Supports multiple statements per request.
Source§fn do_prepare(
&mut self,
sql: String,
) -> impl Future<Output = Result<Query<Self::Driver>>> + Send
fn do_prepare( &mut self, sql: String, ) -> impl Future<Output = Result<Query<Self::Driver>>> + Send
Actual implementation for
prepare.Source§fn run<'s>(
&'s mut self,
query: impl AsQuery<Self::Driver> + 's,
) -> impl Stream<Item = Result<QueryResult>> + Send
fn run<'s>( &'s mut self, query: impl AsQuery<Self::Driver> + 's, ) -> impl Stream<Item = Result<QueryResult>> + Send
Execute a query, streaming
QueryResult (rows or affected counts).Source§fn fetch<'s>(
&'s mut self,
query: impl AsQuery<Self::Driver> + 's,
) -> impl Stream<Item = Result<RowLabeled>> + Send + 's
fn fetch<'s>( &'s mut self, query: impl AsQuery<Self::Driver> + 's, ) -> impl Stream<Item = Result<RowLabeled>> + Send + 's
Execute a query yielding
RowLabeled from the resulting stream (filtering out RowsAffected).Source§fn execute<'s>(
&'s mut self,
query: impl AsQuery<Self::Driver> + 's,
) -> impl Future<Output = Result<RowsAffected>> + Send
fn execute<'s>( &'s mut self, query: impl AsQuery<Self::Driver> + 's, ) -> impl Future<Output = Result<RowsAffected>> + Send
Execute and aggregate affected rows counter.
Auto Trait Implementations§
impl<'c> Freeze for MySQLTransaction<'c>
impl<'c> !RefUnwindSafe for MySQLTransaction<'c>
impl<'c> Send for MySQLTransaction<'c>
impl<'c> Sync for MySQLTransaction<'c>
impl<'c> Unpin for MySQLTransaction<'c>
impl<'c> UnsafeUnpin for MySQLTransaction<'c>
impl<'c> !UnwindSafe for MySQLTransaction<'c>
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