Struct sqlx_core::query_as::QueryAs [−][src]
Raw SQL query with bind parameters, mapped to a concrete type using FromRow
.
Returned from query_as
.
Implementations
impl<'q, DB: Database, O> QueryAs<'q, DB, O, <DB as HasArguments<'q>>::Arguments>
[src][−]
pub fn bind<T: 'q + Send + Encode<'q, DB> + Type<DB>>(
mut self: Self,
value: T
) -> Self
[src][−]
mut self: Self,
value: T
) -> Self
Bind a value for use with this SQL query.
See Query::bind
.
impl<'q, DB, O, A> QueryAs<'q, DB, O, A> where
DB: Database,
A: 'q + IntoArguments<'q, DB>,
O: Send + Unpin + for<'r> FromRow<'r, DB::Row>,
[src][−]
DB: Database,
A: 'q + IntoArguments<'q, DB>,
O: Send + Unpin + for<'r> FromRow<'r, DB::Row>,
pub fn fetch<'e, 'c: 'e, E>(
self,
executor: E
) -> BoxStream<'e, Result<O, Error>> where
'q: 'e,
E: 'e + Executor<'c, Database = DB>,
DB: 'e,
O: 'e,
A: 'e,
[src][−]
self,
executor: E
) -> BoxStream<'e, Result<O, Error>> where
'q: 'e,
E: 'e + Executor<'c, Database = DB>,
DB: 'e,
O: 'e,
A: 'e,
Execute the query and return the generated results as a stream.
pub fn fetch_many<'e, 'c: 'e, E>(
self,
executor: E
) -> BoxStream<'e, Result<Either<DB::QueryResult, O>, Error>> where
'q: 'e,
E: 'e + Executor<'c, Database = DB>,
DB: 'e,
O: 'e,
A: 'e,
[src][−]
self,
executor: E
) -> BoxStream<'e, Result<Either<DB::QueryResult, O>, Error>> where
'q: 'e,
E: 'e + Executor<'c, Database = DB>,
DB: 'e,
O: 'e,
A: 'e,
Execute multiple queries and return the generated results as a stream from each query, in a stream.
pub async fn fetch_all<'e, 'c: 'e, E>(
self,
executor: E
) -> Result<Vec<O>, Error> where
'q: 'e,
E: 'e + Executor<'c, Database = DB>,
DB: 'e,
O: 'e,
A: 'e,
[src][−]
self,
executor: E
) -> Result<Vec<O>, Error> where
'q: 'e,
E: 'e + Executor<'c, Database = DB>,
DB: 'e,
O: 'e,
A: 'e,
Execute the query and return all the generated results, collected into a Vec
.
pub async fn fetch_one<'e, 'c: 'e, E>(self, executor: E) -> Result<O, Error> where
'q: 'e,
E: 'e + Executor<'c, Database = DB>,
DB: 'e,
O: 'e,
A: 'e,
[src][−]
'q: 'e,
E: 'e + Executor<'c, Database = DB>,
DB: 'e,
O: 'e,
A: 'e,
Execute the query and returns exactly one row.
pub async fn fetch_optional<'e, 'c: 'e, E>(
self,
executor: E
) -> Result<Option<O>, Error> where
'q: 'e,
E: 'e + Executor<'c, Database = DB>,
DB: 'e,
O: 'e,
A: 'e,
[src][−]
self,
executor: E
) -> Result<Option<O>, Error> where
'q: 'e,
E: 'e + Executor<'c, Database = DB>,
DB: 'e,
O: 'e,
A: 'e,
Execute the query and returns at most one row.
Trait Implementations
impl<'q, DB, O: Send, A: Send> Execute<'q, DB> for QueryAs<'q, DB, O, A> where
DB: Database,
A: 'q + IntoArguments<'q, DB>,
[src][+]
DB: Database,
A: 'q + IntoArguments<'q, DB>,
Auto Trait Implementations
impl<'q, DB, O, A> RefUnwindSafe for QueryAs<'q, DB, O, A> where
A: RefUnwindSafe,
DB: RefUnwindSafe,
O: RefUnwindSafe,
<DB as HasStatement<'q>>::Statement: RefUnwindSafe,
[src]
A: RefUnwindSafe,
DB: RefUnwindSafe,
O: RefUnwindSafe,
<DB as HasStatement<'q>>::Statement: RefUnwindSafe,
impl<'q, DB, O, A> Send for QueryAs<'q, DB, O, A> where
A: Send,
O: Send,
[src]
A: Send,
O: Send,
impl<'q, DB, O, A> Sync for QueryAs<'q, DB, O, A> where
A: Sync,
DB: Sync,
O: Sync,
[src]
A: Sync,
DB: Sync,
O: Sync,
impl<'q, DB, O, A> Unpin for QueryAs<'q, DB, O, A> where
A: Unpin,
DB: Unpin,
O: Unpin,
[src]
A: Unpin,
DB: Unpin,
O: Unpin,
impl<'q, DB, O, A> UnwindSafe for QueryAs<'q, DB, O, A> where
A: UnwindSafe,
DB: UnwindSafe,
O: UnwindSafe,
<DB as HasStatement<'q>>::Statement: RefUnwindSafe,
[src]
A: UnwindSafe,
DB: UnwindSafe,
O: UnwindSafe,
<DB as HasStatement<'q>>::Statement: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> Conv for T
[+]
impl<T> Conv for T
[+]
impl<T> FmtForward for T
[+]
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T> Pipe for T where
T: ?Sized,
[+]
T: ?Sized,
impl<T> Pipe for T
[+]
impl<T> PipeAsRef for T
[+]
impl<T> PipeBorrow for T
[+]
impl<T> PipeDeref for T
[+]
impl<T> PipeRef for T
[+]
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> Tap for T
[+]
impl<T> Tap for T
[+]
impl<T, U> TapAsRef<U> for T where
U: ?Sized,
[+]
U: ?Sized,
impl<T, U> TapBorrow<U> for T where
U: ?Sized,
[+]
U: ?Sized,
impl<T> TapDeref for T
[+]
impl<T> TryConv for T
[+]
impl<T> TryConv for T
[+]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[+]
V: MultiLane<T>,