[−][src]Struct sqlx::query::QueryScalar
Raw SQL query with bind parameters, mapped to a concrete type using FromRow
on (O,)
.
Returned from query_scalar
.
Implementations
impl<'q, DB, O> QueryScalar<'q, DB, O, <DB as HasArguments<'q>>::Arguments> where
DB: Database,
[src]
DB: Database,
pub fn bind<T>(
self,
value: T
) -> QueryScalar<'q, DB, O, <DB as HasArguments<'q>>::Arguments> where
T: 'q + Encode<'q, DB> + Type<DB> + Send,
[src]
self,
value: T
) -> QueryScalar<'q, DB, O, <DB as HasArguments<'q>>::Arguments> where
T: 'q + Encode<'q, DB> + Type<DB> + Send,
Bind a value for use with this SQL query.
See Query::bind
.
impl<'q, DB, O, A> QueryScalar<'q, DB, O, A> where
A: 'q + IntoArguments<'q, DB>,
DB: Database,
O: Send + Unpin,
(O,): Send,
(O,): Unpin,
(O,): for<'r> FromRow<'r, <DB as Database>::Row>,
[src]
A: 'q + IntoArguments<'q, DB>,
DB: Database,
O: Send + Unpin,
(O,): Send,
(O,): Unpin,
(O,): for<'r> FromRow<'r, <DB as Database>::Row>,
pub fn fetch<'e, 'c, E>(
self,
executor: E
) -> Pin<Box<dyn Stream<Item = Result<O, Error>> + 'e + Send>> where
'c: 'e,
'q: 'e,
A: 'e,
DB: 'e,
E: 'e + Executor<'c, Database = DB>,
O: 'e,
[src]
self,
executor: E
) -> Pin<Box<dyn Stream<Item = Result<O, Error>> + 'e + Send>> where
'c: 'e,
'q: 'e,
A: 'e,
DB: 'e,
E: 'e + Executor<'c, Database = DB>,
O: 'e,
Execute the query and return the generated results as a stream.
pub fn fetch_many<'e, 'c, E>(
self,
executor: E
) -> Pin<Box<dyn Stream<Item = Result<Either<<DB as Database>::Done, O>, Error>> + 'e + Send>> where
'c: 'e,
'q: 'e,
A: 'e,
DB: 'e,
E: 'e + Executor<'c, Database = DB>,
O: 'e,
[src]
self,
executor: E
) -> Pin<Box<dyn Stream<Item = Result<Either<<DB as Database>::Done, O>, Error>> + 'e + Send>> where
'c: 'e,
'q: 'e,
A: 'e,
DB: 'e,
E: 'e + Executor<'c, Database = DB>,
O: '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>(self, executor: E) -> Result<Vec<O>, Error> where
'c: 'e,
'q: 'e,
A: 'e,
DB: 'e,
E: 'e + Executor<'c, Database = DB>,
(O,): 'e,
[src]
'c: 'e,
'q: 'e,
A: 'e,
DB: 'e,
E: 'e + Executor<'c, Database = DB>,
(O,): 'e,
Execute the query and return all the generated results, collected into a Vec
.
pub async fn fetch_one<'e, 'c, E>(self, executor: E) -> Result<O, Error> where
'c: 'e,
'q: 'e,
A: 'e,
DB: 'e,
E: 'e + Executor<'c, Database = DB>,
O: 'e,
[src]
'c: 'e,
'q: 'e,
A: 'e,
DB: 'e,
E: 'e + Executor<'c, Database = DB>,
O: 'e,
Execute the query and returns exactly one row.
pub async fn fetch_optional<'e, 'c, E>(
self,
executor: E
) -> Result<Option<O>, Error> where
'c: 'e,
'q: 'e,
A: 'e,
DB: 'e,
E: 'e + Executor<'c, Database = DB>,
O: 'e,
[src]
self,
executor: E
) -> Result<Option<O>, Error> where
'c: 'e,
'q: 'e,
A: 'e,
DB: 'e,
E: 'e + Executor<'c, Database = DB>,
O: 'e,
Execute the query and returns at most one row.
Trait Implementations
impl<'q, DB, O, A> Execute<'q, DB> for QueryScalar<'q, DB, O, A> where
A: Send + 'q + IntoArguments<'q, DB>,
DB: Database,
O: Send,
[src]
A: Send + 'q + IntoArguments<'q, DB>,
DB: Database,
O: Send,
fn sql(&self) -> &'q str
[src]
fn statement(&self) -> Option<&<DB as HasStatement<'q>>::Statement>
[src]
fn take_arguments(&mut self) -> Option<<DB as HasArguments<'q>>::Arguments>
[src]
fn persistent(&self) -> bool
[src]
Auto Trait Implementations
impl<'q, DB, O, A> RefUnwindSafe for QueryScalar<'q, DB, O, A> where
A: RefUnwindSafe,
DB: RefUnwindSafe,
O: RefUnwindSafe,
<DB as HasStatement<'q>>::Statement: RefUnwindSafe,
A: RefUnwindSafe,
DB: RefUnwindSafe,
O: RefUnwindSafe,
<DB as HasStatement<'q>>::Statement: RefUnwindSafe,
impl<'q, DB, O, A> Send for QueryScalar<'q, DB, O, A> where
A: Send,
O: Send,
<DB as HasStatement<'q>>::Statement: Sync,
A: Send,
O: Send,
<DB as HasStatement<'q>>::Statement: Sync,
impl<'q, DB, O, A> Sync for QueryScalar<'q, DB, O, A> where
A: Sync,
DB: Sync,
O: Sync,
<DB as HasStatement<'q>>::Statement: Sync,
A: Sync,
DB: Sync,
O: Sync,
<DB as HasStatement<'q>>::Statement: Sync,
impl<'q, DB, O, A> Unpin for QueryScalar<'q, DB, O, A> where
A: Unpin,
DB: Unpin,
O: Unpin,
A: Unpin,
DB: Unpin,
O: Unpin,
impl<'q, DB, O, A> UnwindSafe for QueryScalar<'q, DB, O, A> where
A: UnwindSafe,
DB: UnwindSafe,
O: UnwindSafe,
<DB as HasStatement<'q>>::Statement: RefUnwindSafe,
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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,