pub mod conflict;
pub mod insert_select;
pub mod states;
pub use conflict::*;
pub use insert_select::*;
pub use states::*;
#[diagnostic::on_unimplemented(
message = "this query is not complete yet: `{Self}` cannot run",
label = "the query is still missing a clause",
note = "a DELETE or UPDATE must say which rows it changes with `.r#where(...)`; write \
`.r#where(true)` to change every row on purpose",
note = "a SELECT needs `.from(...)`, an INSERT needs `.values(...)`, and an UPDATE \
needs `.set(...)`"
)]
pub trait ExecutableState {
type Rows<R: crate::row::RowCount>: crate::row::RowCount;
}
#[derive(Debug, Clone)]
pub struct BuilderInit;
impl ExecutableState for BuilderInit {
type Rows<R: crate::row::RowCount> = crate::row::ZeroOrMore;
}
pub mod clause {
#[derive(Debug, Clone, Copy, Default)]
pub struct Where;
#[derive(Debug, Clone, Copy, Default)]
pub struct GroupBy;
#[derive(Debug, Clone, Copy, Default)]
pub struct Having;
#[derive(Debug, Clone, Copy, Default)]
pub struct OrderBy;
#[derive(Debug, Clone, Copy, Default)]
pub struct Limit;
#[derive(Debug, Clone, Copy, Default)]
pub struct Offset;
#[derive(Debug, Clone, Copy, Default)]
pub struct Join;
#[derive(Debug, Clone, Copy, Default)]
pub struct Simple;
#[derive(Debug, Clone, Copy, Default)]
pub struct Compound;
#[derive(Debug, Clone, Copy, Default)]
pub struct Source;
}
#[diagnostic::on_unimplemented(
message = "builder state `{Self}` does not allow `{Clause}`",
label = "not available at this point of the query",
note = "SELECT clauses go in order: FROM, JOIN, WHERE, GROUP BY, HAVING, ORDER BY, LIMIT, OFFSET",
note = "only a SELECT can be a set operand, a subquery, a derived table, or an INSERT source"
)]
pub trait ClauseAllowed<Clause> {}