DataSet

Trait DataSet 

Source
pub trait DataSet {
    // Required methods
    fn qualified_columns() -> bool
       where Self: Sized;
    fn write_query(
        &self,
        writer: &dyn SqlWriter,
        context: &mut Context,
        out: &mut String,
    );

    // Provided methods
    fn select<'s, Exec, Item, Cols, Expr>(
        &'s self,
        executor: &'s mut Exec,
        columns: Cols,
        condition: Expr,
        limit: Option<u32>,
    ) -> impl Stream<Item = Result<RowLabeled>> + 's
       where Self: Sized,
             Exec: Executor,
             Item: Expression,
             Cols: IntoIterator<Item = Item> + Clone,
             Expr: Expression { ... }
    fn prepare<Exec, Item, Cols, Expr>(
        &self,
        executor: &mut Exec,
        columns: Cols,
        condition: &Expr,
        limit: Option<u32>,
    ) -> impl Future<Output = Result<Query<Exec::Driver>>>
       where Self: Sized,
             Item: Expression,
             Cols: IntoIterator<Item = Item> + Clone,
             Exec: Executor,
             Expr: Expression { ... }
}
Expand description

Queryable data source (table or join tree).

Implementors know how to render themselves inside a FROM clause and whether column references should be qualified with schema and table.

Required Methods§

Source

fn qualified_columns() -> bool
where Self: Sized,

Should columns be qualified (schema.table.col)?

Source

fn write_query( &self, writer: &dyn SqlWriter, context: &mut Context, out: &mut String, )

Render into out.

Provided Methods§

Source

fn select<'s, Exec, Item, Cols, Expr>( &'s self, executor: &'s mut Exec, columns: Cols, condition: Expr, limit: Option<u32>, ) -> impl Stream<Item = Result<RowLabeled>> + 's
where Self: Sized, Exec: Executor, Item: Expression, Cols: IntoIterator<Item = Item> + Clone, Expr: Expression,

Fetch a SELECT query and stream labeled rows.

Source

fn prepare<Exec, Item, Cols, Expr>( &self, executor: &mut Exec, columns: Cols, condition: &Expr, limit: Option<u32>, ) -> impl Future<Output = Result<Query<Exec::Driver>>>
where Self: Sized, Item: Expression, Cols: IntoIterator<Item = Item> + Clone, Exec: Executor, Expr: Expression,

Prepare a SELECT query.

Trait Implementations§

Source§

impl DataSet for &dyn DataSet

Source§

fn qualified_columns() -> bool
where Self: Sized,

Should columns be qualified (schema.table.col)?
Source§

fn write_query( &self, writer: &dyn SqlWriter, context: &mut Context, out: &mut String, )

Render into out.
Source§

fn select<'s, Exec, Item, Cols, Expr>( &'s self, executor: &'s mut Exec, columns: Cols, condition: Expr, limit: Option<u32>, ) -> impl Stream<Item = Result<RowLabeled>> + 's
where Self: Sized, Exec: Executor, Item: Expression, Cols: IntoIterator<Item = Item> + Clone, Expr: Expression,

Fetch a SELECT query and stream labeled rows.
Source§

fn prepare<Exec, Item, Cols, Expr>( &self, executor: &mut Exec, columns: Cols, condition: &Expr, limit: Option<u32>, ) -> impl Future<Output = Result<Query<Exec::Driver>>>
where Self: Sized, Item: Expression, Cols: IntoIterator<Item = Item> + Clone, Exec: Executor, Expr: Expression,

Prepare a SELECT query.

Implementors§