Skip to main content

SelectableDataSource

Trait SelectableDataSource 

Source
pub trait SelectableDataSource<T = Value, C = Expression<T>>: DataSource {
    type Select: Selectable<T, C>;

    // Required methods
    fn select(&self) -> Self::Select;
    fn execute_select(
        &self,
        select: &Self::Select,
    ) -> impl Future<Output = Result<Vec<T>>> + Send;

    // Provided method
    fn add_select_column(
        &self,
        select: &mut Self::Select,
        expression: Expression<T>,
        alias: Option<&str>,
    )
       where T: Clone { ... }
}
Expand description

Datasource that support creation and execution of select queries

Required Associated Types§

Required Methods§

Source

fn select(&self) -> Self::Select

Source

fn execute_select( &self, select: &Self::Select, ) -> impl Future<Output = Result<Vec<T>>> + Send

Provided Methods§

Source

fn add_select_column( &self, select: &mut Self::Select, expression: Expression<T>, alias: Option<&str>, )
where T: Clone,

Add a column expression to a select query with optional alias. Backends must override this if they support aliases.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§