Skip to main content

vantage_sql/primitives/select/
mod.rs

1pub mod window;
2
3use vantage_expressions::Expression;
4
5/// Trait for dialect-specific SELECT extensions beyond `Selectable`:
6/// joins, HAVING, CTEs, and named windows.
7///
8/// Implemented by each backend's Select type (SqliteSelect, PostgresSelect, etc.)
9pub trait SelectBuilder<V>: Clone {
10    type Join;
11
12    fn push_join(&mut self, join: Self::Join);
13    fn push_having(&mut self, cond: Expression<V>);
14    fn push_cte(&mut self, name: String, query: Expression<V>, recursive: bool);
15}
16
17/// Trait for constructing dialect-specific join clauses.
18pub trait JoinBuilder<V>: Sized {
19    fn make_inner(table: &str, alias: &str, on: Expression<V>) -> Self;
20    fn make_left(table: &str, alias: &str, on: Expression<V>) -> Self;
21}