use crate::types::*;
pub struct InsertParams {
pub collection: String,
pub columns: Vec<String>,
pub rows: Vec<Vec<(String, SqlValue)>>,
pub volatile_defaults: bool,
pub if_absent: bool,
pub column_schema: Vec<(String, String)>,
pub primary_key: Option<String>,
}
pub struct ScanParams {
pub collection: String,
pub alias: Option<String>,
pub filters: Vec<Filter>,
pub projection: Vec<Projection>,
pub sort_keys: Vec<SortKey>,
pub limit: Option<usize>,
pub offset: usize,
pub distinct: bool,
pub window_functions: Vec<WindowSpec>,
pub indexes: Vec<IndexSpec>,
pub temporal: crate::temporal::TemporalScope,
pub bitemporal: bool,
pub has_auto_tier: bool,
}
pub struct PointGetParams {
pub collection: String,
pub alias: Option<String>,
pub key_column: String,
pub key_value: SqlValue,
pub projection: Vec<Projection>,
}
pub struct UpdateParams {
pub collection: String,
pub assignments: Vec<(String, SqlExpr)>,
pub filters: Vec<Filter>,
pub target_keys: Vec<SqlValue>,
pub returning: bool,
}
pub struct UpdateFromParams {
pub collection: String,
pub source: Box<SqlPlan>,
pub source_alias: String,
pub target_join_col: String,
pub source_join_col: String,
pub assignments: Vec<(String, SqlExpr)>,
pub target_filters: Vec<Filter>,
pub returning: bool,
}
pub struct DeleteParams {
pub collection: String,
pub filters: Vec<Filter>,
pub target_keys: Vec<SqlValue>,
}
pub struct TruncateParams {
pub collection: String,
pub restart_identity: bool,
}
pub struct InsertSelectParams {
pub collection: String,
pub source: Box<SqlPlan>,
pub column_map: Vec<(String, SqlExpr)>,
pub source_columns: Vec<(String, String)>,
}
pub struct MergeParams {
pub collection: String,
pub source: Box<SqlPlan>,
pub target_join_col: String,
pub source_join_col: String,
pub source_alias: String,
pub clauses: Vec<crate::types::MergePlanClause>,
pub returning: bool,
}
pub struct UpsertParams {
pub collection: String,
pub columns: Vec<String>,
pub rows: Vec<Vec<(String, SqlValue)>>,
pub volatile_defaults: bool,
pub on_conflict_updates: Vec<(String, SqlExpr)>,
pub column_schema: Vec<(String, String)>,
pub primary_key: Option<String>,
}
pub struct AggregateParams {
pub collection: String,
pub alias: Option<String>,
pub filters: Vec<Filter>,
pub group_by: Vec<SqlExpr>,
pub aggregates: Vec<AggregateExpr>,
pub having: Vec<Filter>,
pub limit: usize,
pub time_bucket: Option<TimeBucketKey>,
pub grouping_sets: Option<Vec<Vec<usize>>>,
pub columns: Vec<ColumnInfo>,
pub hidden_aggregates: bool,
pub input_joins: bool,
pub has_auto_tier: bool,
pub bitemporal: bool,
pub temporal: crate::temporal::TemporalScope,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct TimeBucketKey {
pub group_index: usize,
pub interval_ms: i64,
}