1#![cfg_attr(docsrs, feature(doc_cfg))]
4
5pub trait Query {
9 type FromQuery: FromQuery;
10
11 fn from(from: Self) -> Self::FromQuery;
13}
14
15#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Hash)]
16pub enum Join {
17 Inner,
18 Left,
19 Right,
20 Outer,
21 Cross,
22}
23
24pub trait JoinQuery: Query {
26 type On;
28
29 fn join(from: Self, join: Join, to: Self, on: Self::On) -> Self::FromQuery;
31}
32
33pub trait FromQuery {
35 type WhereClause;
36 type WhereQuery;
37
38 type SelectClause;
39 type SelectQuery;
40
41 fn where_(self, cond: Self::WhereClause) -> Self::WhereQuery;
43
44 fn select(&self, clause: Self::SelectClause) -> Self::SelectQuery;
46}
47
48pub trait WhereQuery {
50 type SelectClause;
51 type SelectQuery;
52
53 fn select(&self, clause: Self::SelectClause) -> Self::SelectQuery;
55}
56
57pub trait SelectQuery {
59 type Result;
61
62 fn exec(self) -> Self::Result;
64}