#![cfg_attr(docsrs, feature(doc_cfg))]
pub trait Query {
type FromQuery: FromQuery;
fn from(from: Self) -> Self::FromQuery;
}
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Hash)]
pub enum Join {
Inner,
Left,
Right,
Outer,
Cross,
}
pub trait JoinQuery: Query {
type On;
fn join(from: Self, join: Join, to: Self, on: Self::On) -> Self::FromQuery;
}
pub trait FromQuery {
type WhereClause;
type WhereQuery;
type SelectClause;
type SelectQuery;
fn where_(self, cond: Self::WhereClause) -> Self::WhereQuery;
fn select(&self, clause: Self::SelectClause) -> Self::SelectQuery;
}
pub trait WhereQuery {
type SelectClause;
type SelectQuery;
fn select(&self, clause: Self::SelectClause) -> Self::SelectQuery;
}
pub trait SelectQuery {
type Result;
fn exec(self) -> Self::Result;
}