use crate::types_expr::SqlExpr;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum EngineType {
DocumentSchemaless,
DocumentStrict,
KeyValue,
Columnar,
Timeseries,
Spatial,
Array,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum JoinType {
Inner,
Left,
Right,
Full,
Semi,
Anti,
Cross,
}
impl JoinType {
pub fn as_str(&self) -> &'static str {
match self {
Self::Inner => "inner",
Self::Left => "left",
Self::Right => "right",
Self::Full => "full",
Self::Semi => "semi",
Self::Anti => "anti",
Self::Cross => "cross",
}
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum SpatialPredicate {
DWithin,
Contains,
Intersects,
Within,
}
#[derive(Debug, Clone)]
pub enum Projection {
Column(String),
Star,
QualifiedStar(String),
Computed { expr: SqlExpr, alias: String },
}
#[derive(Debug, Clone)]
pub struct SortKey {
pub expr: SqlExpr,
pub ascending: bool,
pub nulls_first: bool,
}
#[derive(Debug, Clone)]
pub struct AggregateExpr {
pub function: String,
pub args: Vec<SqlExpr>,
pub alias: String,
pub distinct: bool,
pub grouping_col_index: Option<usize>,
}
#[derive(Debug, Clone)]
pub struct WindowSpec {
pub function: String,
pub args: Vec<SqlExpr>,
pub partition_by: Vec<SqlExpr>,
pub order_by: Vec<SortKey>,
pub alias: String,
pub frame: nodedb_query::WindowFrame,
}