Struct sqlx_core::query_scalar::QueryScalar [−][src]
pub struct QueryScalar<'q, DB: Database, O, A> { /* fields omitted */ }
Expand description
Raw SQL query with bind parameters, mapped to a concrete type using FromRow
on (O,)
.
Returned from query_scalar
.
Implementations
If true
, the statement will get prepared once and cached to the
connection’s statement cache.
If queried once with the flag set to true
, all subsequent queries
matching the one with the flag will use the cached statement until the
cache is cleared.
Default: true
.
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,
A: 'e,
O: 'e,
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,
A: 'e,
O: 'e,
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: Database, O: Send, A: Send> Execute<'q, DB> for QueryScalar<'q, DB, O, A> where
A: 'q + IntoArguments<'q, DB>,
impl<'q, DB: Database, O: Send, A: Send> Execute<'q, DB> for QueryScalar<'q, DB, O, A> where
A: '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.