pub enum Query<D: Driver> {
Raw(String),
Prepared(D::Prepared),
}Expand description
A query ready to be executed by an Executor.
Represents either raw SQL (Raw) or a backend prepared statement
(Prepared) carrying driver-specific caching / parsing state.
Variants§
Implementations§
Source§impl<D: Driver> Query<D>
impl<D: Driver> Query<D>
Sourcepub fn run<'e, Exec: Executor<Driver = D>>(
self,
executor: &mut Exec,
) -> impl Stream<Item = Result<QueryResult>> + Send
pub fn run<'e, Exec: Executor<Driver = D>>( self, executor: &mut Exec, ) -> impl Stream<Item = Result<QueryResult>> + Send
Execute the query streaming heterogeneous QueryResult items.
Sourcepub fn fetch_one<Exec: Executor<Driver = D>>(
self,
executor: &mut Exec,
) -> impl Future<Output = Result<Option<RowLabeled>>> + Send
pub fn fetch_one<Exec: Executor<Driver = D>>( self, executor: &mut Exec, ) -> impl Future<Output = Result<Option<RowLabeled>>> + Send
Fetch at most one labeled row.
Sourcepub fn fetch_many<Exec: Executor<Driver = D>>(
self,
executor: &mut Exec,
) -> impl Stream<Item = Result<RowLabeled>> + Send
pub fn fetch_many<Exec: Executor<Driver = D>>( self, executor: &mut Exec, ) -> impl Stream<Item = Result<RowLabeled>> + Send
Stream all labeled rows.
Trait Implementations§
Auto Trait Implementations§
impl<D> Freeze for Query<D>
impl<D> RefUnwindSafe for Query<D>
impl<D> Send for Query<D>
impl<D> Sync for Query<D>
impl<D> Unpin for Query<D>
impl<D> UnwindSafe for Query<D>
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