Struct sea_orm::SqlxMySqlPoolConnection
source · [−]pub struct SqlxMySqlPoolConnection { /* private fields */ }Expand description
Defines a sqlx MySQL pool
Implementations
sourceimpl SqlxMySqlPoolConnection
impl SqlxMySqlPoolConnection
sourcepub async fn execute(&self, stmt: Statement) -> Result<ExecResult, DbErr>
pub async fn execute(&self, stmt: Statement) -> Result<ExecResult, DbErr>
Execute a Statement on a MySQL backend
sourcepub async fn query_one(
&self,
stmt: Statement
) -> Result<Option<QueryResult>, DbErr>
pub async fn query_one(
&self,
stmt: Statement
) -> Result<Option<QueryResult>, DbErr>
Get one result from a SQL query. Returns Option::None if no match was found
sourcepub async fn query_all(&self, stmt: Statement) -> Result<Vec<QueryResult>, DbErr>
pub async fn query_all(&self, stmt: Statement) -> Result<Vec<QueryResult>, DbErr>
Get the results of a query returning them as a Vec<QueryResult>
sourcepub async fn stream(&self, stmt: Statement) -> Result<QueryStream, DbErr>
pub async fn stream(&self, stmt: Statement) -> Result<QueryStream, DbErr>
Stream the results of executing a SQL query
sourcepub async fn begin(&self) -> Result<DatabaseTransaction, DbErr>
pub async fn begin(&self) -> Result<DatabaseTransaction, DbErr>
Bundle a set of SQL statements that execute together.
sourcepub async fn transaction<F, T, E>(
&self,
callback: F
) -> Result<T, TransactionError<E>> where
F: for<'b> FnOnce(&'b DatabaseTransaction) -> Pin<Box<dyn Future<Output = Result<T, E>> + Send + 'b>> + Send,
T: Send,
E: Error + Send,
pub async fn transaction<F, T, E>(
&self,
callback: F
) -> Result<T, TransactionError<E>> where
F: for<'b> FnOnce(&'b DatabaseTransaction) -> Pin<Box<dyn Future<Output = Result<T, E>> + Send + 'b>> + Send,
T: Send,
E: Error + Send,
Create a MySQL transaction
Trait Implementations
sourceimpl Clone for SqlxMySqlPoolConnection
impl Clone for SqlxMySqlPoolConnection
sourcefn clone(&self) -> SqlxMySqlPoolConnection
fn clone(&self) -> SqlxMySqlPoolConnection
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
Auto Trait Implementations
impl !RefUnwindSafe for SqlxMySqlPoolConnection
impl Send for SqlxMySqlPoolConnection
impl Sync for SqlxMySqlPoolConnection
impl Unpin for SqlxMySqlPoolConnection
impl !UnwindSafe for SqlxMySqlPoolConnection
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more