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,

Whether columns should be qualified (schema.table.column).

Source

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

Write the textual representation into out using the given writer.

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,

Execute a SELECT, streaming 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 (but do not yet run) a SQL select query.

Trait Implementations§

Source§

impl DataSet for &dyn DataSet

Source§

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

Whether columns should be qualified (schema.table.column).
Source§

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

Write the textual representation into out using the given writer.
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,

Execute a SELECT, streaming 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 (but do not yet run) a SQL select query.

Implementors§