1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use expression::*;
use query_builder::{Query, AsQuery};
use query_source::Table;
pub trait SelectDsl<Selection: Expression> {
type Output: Query<SqlType=<Selection as Expression>::SqlType>;
fn select(self, selection: Selection) -> Self::Output;
}
impl<T, Selection> SelectDsl<Selection> for T where
Selection: Expression,
T: Table + AsQuery,
T::Query: SelectDsl<Selection>,
{
type Output = <T::Query as SelectDsl<Selection>>::Output;
fn select(self, selection: Selection) -> Self::Output {
self.as_query().select(selection)
}
}