use crate::expression::Expression; use crate::query_source::Table; /// The `select` method /// /// This trait should not be relied on directly by most apps. Its behavior is /// provided by [`QueryDsl`]. However, you may need a where clause on this trait /// to call `select` from generic code. /// /// [`QueryDsl`]: crate::QueryDsl pub trait SelectDsl { // FIXME: Once we've refactored the `impl Expression` on `SelectStatement` // to not conditionally be `sql_types::Array`, it is probably worthwhile to // add a `: Expression` bound here. /// The type returned by `.select` type Output; /// See the trait documentation fn select(self, selection: Selection) -> Self::Output; } impl SelectDsl for T where Selection: Expression, T: Table, T::Query: SelectDsl, { type Output = >::Output; fn select(self, selection: Selection) -> Self::Output { self.as_query().select(selection) } }