ViewQueryEngine

Trait ViewQueryEngine 

Source
pub trait ViewQueryEngine: QueryEngine {
    // Required methods
    fn query_view_many<V: View + Send + 'static>(
        &self,
        sql: &str,
        params: Vec<FilterValue>,
    ) -> BoxFuture<'_, QueryResult<Vec<V>>>;
    fn query_view_optional<V: View + Send + 'static>(
        &self,
        sql: &str,
        params: Vec<FilterValue>,
    ) -> BoxFuture<'_, QueryResult<Option<V>>>;

    // Provided method
    fn count_view(
        &self,
        sql: &str,
        params: Vec<FilterValue>,
    ) -> BoxFuture<'_, QueryResult<u64>> { ... }
}
Expand description

Query engine extension for view operations.

Required Methods§

Source

fn query_view_many<V: View + Send + 'static>( &self, sql: &str, params: Vec<FilterValue>, ) -> BoxFuture<'_, QueryResult<Vec<V>>>

Query rows from a view.

Source

fn query_view_optional<V: View + Send + 'static>( &self, sql: &str, params: Vec<FilterValue>, ) -> BoxFuture<'_, QueryResult<Option<V>>>

Query a single row from a view.

Provided Methods§

Source

fn count_view( &self, sql: &str, params: Vec<FilterValue>, ) -> BoxFuture<'_, QueryResult<u64>>

Count rows in a view.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§