rocket_db_pools::diesel::prelude

Trait QuerySource

Source
pub trait QuerySource {
    type FromClause;
    type DefaultSelection: SelectableExpression<Self>;

    // Required methods
    fn from_clause(&self) -> Self::FromClause;
    fn default_selection(&self) -> Self::DefaultSelection;
}
Expand description

Represents a type which can appear in the FROM clause. Apps should not need to concern themselves with this trait.

Types which implement this trait include:

  • Tables generated by the table! macro
  • Internal structs which represent joins
  • A select statement which has had no query builder methods called on it, other than those which can affect the from clause.

Required Associated Types§

Source

type FromClause

The type returned by from_clause

Source

type DefaultSelection: SelectableExpression<Self>

The type returned by default_selection

Required Methods§

Source

fn from_clause(&self) -> Self::FromClause

The actual FROM clause of this type. This is typically only called in QueryFragment implementations.

Source

fn default_selection(&self) -> Self::DefaultSelection

The default select clause of this type, which should be used if no select clause was explicitly specified. This should always be a tuple of all the desired columns, not star

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§

Source§

impl<From> QuerySource for SelectStatement<From>
where From: AsQuerySource, <<From as AsQuerySource>::QuerySource as QuerySource>::DefaultSelection: SelectableExpression<SelectStatement<From>>,

Source§

type FromClause = <<From as AsQuerySource>::QuerySource as QuerySource>::FromClause

Source§

type DefaultSelection = <<From as AsQuerySource>::QuerySource as QuerySource>::DefaultSelection

Source§

impl<S> QuerySource for Only<S>

Source§

impl<S> QuerySource for Alias<S>
where Alias<S>: Clone, S: AliasSource, <S as AliasSource>::Target: QuerySource, <<S as AliasSource>::Target as QuerySource>::DefaultSelection: FieldAliasMapper<S>, <<<S as AliasSource>::Target as QuerySource>::DefaultSelection as FieldAliasMapper<S>>::Out: SelectableExpression<Alias<S>>,

Source§

type FromClause = Alias<S>

Source§

type DefaultSelection = <<<S as AliasSource>::Target as QuerySource>::DefaultSelection as FieldAliasMapper<S>>::Out

Source§

impl<S, TSM> QuerySource for Tablesample<S, TSM>
where S: Table + Clone, TSM: TablesampleMethod, <S as QuerySource>::DefaultSelection: ValidGrouping<()> + SelectableExpression<Tablesample<S, TSM>>,