Skip to main content

ScopedQuery

Trait ScopedQuery 

Source
pub trait ScopedQuery<'q, DB: SqlxDatabase>: Sized + Send {
    // Required methods
    fn execute_scoped(
        self,
    ) -> Pin<Box<dyn Future<Output = Result<DB::QueryResult, DbError>> + Send + 'q>>;
    fn fetch_one_scoped(
        self,
    ) -> Pin<Box<dyn Future<Output = Result<DB::Row, DbError>> + Send + 'q>>;
    fn fetch_optional_scoped(
        self,
    ) -> Pin<Box<dyn Future<Output = Result<Option<DB::Row>, DbError>> + Send + 'q>>;
    fn fetch_all_scoped(
        self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<DB::Row>, DbError>> + Send + 'q>>;
    fn fetch_scoped(self) -> ScopedStream<'q, DB::Row>;
    fn execute_many_scoped(
        self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<DB::QueryResult>, DbError>> + Send + 'q>>;
    fn fetch_many_scoped(
        self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Either<DB::QueryResult, DB::Row>>, DbError>> + Send + 'q>>;
}

Required Methods§

Source

fn execute_scoped( self, ) -> Pin<Box<dyn Future<Output = Result<DB::QueryResult, DbError>> + Send + 'q>>

Source

fn fetch_one_scoped( self, ) -> Pin<Box<dyn Future<Output = Result<DB::Row, DbError>> + Send + 'q>>

Source

fn fetch_optional_scoped( self, ) -> Pin<Box<dyn Future<Output = Result<Option<DB::Row>, DbError>> + Send + 'q>>

Source

fn fetch_all_scoped( self, ) -> Pin<Box<dyn Future<Output = Result<Vec<DB::Row>, DbError>> + Send + 'q>>

Source

fn fetch_scoped(self) -> ScopedStream<'q, DB::Row>

Source

fn execute_many_scoped( self, ) -> Pin<Box<dyn Future<Output = Result<Vec<DB::QueryResult>, DbError>> + Send + 'q>>

Source

fn fetch_many_scoped( self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Either<DB::QueryResult, DB::Row>>, DbError>> + Send + 'q>>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'q, DB, A> ScopedQuery<'q, DB> for Query<'q, DB, A>
where DB: SqlxDatabase + 'static, A: IntoArguments<'q, DB> + Send + 'q, DB::QueryResult: Send + 'q, for<'c> &'c mut DB::Connection: Executor<'c, Database = DB>,

Source§

fn execute_scoped( self, ) -> Pin<Box<dyn Future<Output = Result<DB::QueryResult, DbError>> + Send + 'q>>

Source§

fn fetch_one_scoped( self, ) -> Pin<Box<dyn Future<Output = Result<DB::Row, DbError>> + Send + 'q>>

Source§

fn fetch_optional_scoped( self, ) -> Pin<Box<dyn Future<Output = Result<Option<DB::Row>, DbError>> + Send + 'q>>

Source§

fn fetch_all_scoped( self, ) -> Pin<Box<dyn Future<Output = Result<Vec<DB::Row>, DbError>> + Send + 'q>>

Source§

fn fetch_scoped(self) -> ScopedStream<'q, DB::Row>

Source§

fn execute_many_scoped( self, ) -> Pin<Box<dyn Future<Output = Result<Vec<DB::QueryResult>, DbError>> + Send + 'q>>

Source§

fn fetch_many_scoped( self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Either<DB::QueryResult, DB::Row>>, DbError>> + Send + 'q>>

Implementors§