pub struct MysqlDb { /* private fields */ }Expand description
The store’s driver over a MySQL pool. SQL written for SQLite and Postgres is sent as MySQL reads it: a “quoted” name in backticks, a backslash inside ‘text’ doubled, and each value written into the statement, escaped, as mysql2 fills them in.
Implementations§
Trait Implementations§
Source§impl Db for MysqlDb
impl Db for MysqlDb
Source§fn all<'a>(
&'a self,
sql: &'a str,
params: Vec<Param>,
) -> BoxFuture<'a, Result<Vec<Row>, DbError>>
fn all<'a>( &'a self, sql: &'a str, params: Vec<Param>, ) -> BoxFuture<'a, Result<Vec<Row>, DbError>>
Runs a query and gives its rows.
Source§fn run<'a>(
&'a self,
sql: &'a str,
params: Vec<Param>,
) -> BoxFuture<'a, Result<u64, DbError>>
fn run<'a>( &'a self, sql: &'a str, params: Vec<Param>, ) -> BoxFuture<'a, Result<u64, DbError>>
Runs a statement and says how many rows it matched.
Source§fn hold(&self, kind: Hold) -> BoxFuture<'_, Result<Arc<dyn Db>, DbError>>
fn hold(&self, kind: Hold) -> BoxFuture<'_, Result<Arc<dyn Db>, DbError>>
One connection, held for a transaction or a lock until
finish. Statements on it run in
turn with nothing else of the store’s in between. Holding a transaction on a connection
already in one joins it.Source§fn finish(
&self,
_ok: bool,
) -> Pin<Box<dyn Future<Output = Result<(), DbError>> + Send + '_>>
fn finish( &self, _ok: bool, ) -> Pin<Box<dyn Future<Output = Result<(), DbError>> + Send + '_>>
Ends what
hold began: commits a transaction (ok) or rolls it back, or lets go of a lock.
A connection that was not held answers Ok.Auto Trait Implementations§
impl !RefUnwindSafe for MysqlDb
impl !UnwindSafe for MysqlDb
impl Freeze for MysqlDb
impl Send for MysqlDb
impl Sync for MysqlDb
impl Unpin for MysqlDb
impl UnsafeUnpin for MysqlDb
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more