pub struct MySQLConnection { /* private fields */ }Expand description
Connection wrapper used by the MySQL/MariaDB driver.
Holds the underlying mysql_async connection and adapts it to the tank_core::Connection/Executor APIs.
Trait Implementations§
Source§impl Connection for MySQLConnection
impl Connection for MySQLConnection
Source§async fn connect(url: Cow<'static, str>) -> Result<Self>
async fn connect(url: Cow<'static, str>) -> Result<Self>
Create a connection (or pool) to the given URL. Read more
Source§fn begin(&mut self) -> impl Future<Output = Result<MySQLTransaction<'_>>>
fn begin(&mut self) -> impl Future<Output = Result<MySQLTransaction<'_>>>
Begin a transaction scope tied to this connection. Read more
fn sanitize_url(url: Cow<'static, str>) -> Result<Url, Error>where
Self: Sized,
Source§impl Executor for MySQLConnection
impl Executor for MySQLConnection
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 Freeze for MySQLConnection
impl !RefUnwindSafe for MySQLConnection
impl Send for MySQLConnection
impl Sync for MySQLConnection
impl Unpin for MySQLConnection
impl UnsafeUnpin for MySQLConnection
impl !UnwindSafe for MySQLConnection
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