Struct sqlx::query::QueryScalar [−][src]
pub struct QueryScalar<'q, DB, O, A> where
DB: Database, { /* fields omitted */ }
Expand description
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,
impl<'q, DB, O> QueryScalar<'q, DB, O, <DB as HasArguments<'q>>::Arguments> where
DB: Database,
pub fn bind<T>(
self,
value: T
) -> QueryScalar<'q, DB, O, <DB as HasArguments<'q>>::Arguments> where
T: 'q + Send + Encode<'q, DB> + Type<DB>,
pub fn bind<T>(
self,
value: T
) -> QueryScalar<'q, DB, O, <DB as HasArguments<'q>>::Arguments> where
T: 'q + Send + Encode<'q, DB> + Type<DB>,
Bind a value for use with this SQL query.
See Query::bind
.
Execute the query and return the generated results as a stream.
Execute multiple queries and return the generated results as a stream from each query, in a stream.
Execute the query and return all the generated results, collected into a Vec
.
Execute the query and returns exactly one row.
Trait Implementations
impl<'q, DB, O, A> Execute<'q, DB> for QueryScalar<'q, DB, O, A> where
DB: Database,
O: Send,
A: Send + 'q + IntoArguments<'q, DB>,
impl<'q, DB, O, A> Execute<'q, DB> for QueryScalar<'q, DB, O, A> where
DB: Database,
O: Send,
A: Send + 'q + IntoArguments<'q, DB>,
Gets the previously cached statement, if available.
Returns the arguments to be bound against the query string. Read more
Returns true
if the statement should be cached.