pub enum AnyQuery<'a> {
MySql(Query<'a, MySql, MySqlArguments>),
}
Expand description
Enum variant over a database query
Variants§
MySql(Query<'a, MySql, MySqlArguments>)
Mysql query
Implementations§
Source§impl AnyQuery<'_>
impl AnyQuery<'_>
Sourcepub async fn execute(
self,
con: &mut AnyConnection<'_>,
) -> Result<AnyQueryResult, Error>
pub async fn execute( self, con: &mut AnyConnection<'_>, ) -> Result<AnyQueryResult, Error>
Executes the given query.
Sourcepub async fn fetch_one(
self,
con: &mut AnyConnection<'_>,
) -> Result<AnyRow, Error>
pub async fn fetch_one( self, con: &mut AnyConnection<'_>, ) -> Result<AnyRow, Error>
Execute the query, returning the first row or sqlx::Error::RowNotFound
otherwise.
Sourcepub async fn fetch_all(
self,
con: &mut AnyConnection<'_>,
) -> Result<Vec<AnyRow>, Error>
pub async fn fetch_all( self, con: &mut AnyConnection<'_>, ) -> Result<Vec<AnyRow>, Error>
Execute the query and return all the resulting rows collected into a Vec
.
Sourcepub async fn fetch_optional(
self,
con: &mut AnyConnection<'_>,
) -> Result<Option<AnyRow>, Error>
pub async fn fetch_optional( self, con: &mut AnyConnection<'_>, ) -> Result<Option<AnyRow>, Error>
Execute the query, returning the first row or None
otherwise.
Auto Trait Implementations§
impl<'a> Freeze for AnyQuery<'a>
impl<'a> !RefUnwindSafe for AnyQuery<'a>
impl<'a> Send for AnyQuery<'a>
impl<'a> Sync for AnyQuery<'a>
impl<'a> Unpin for AnyQuery<'a>
impl<'a> !UnwindSafe for AnyQuery<'a>
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> 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