mod core;
mod cursor_policy;
mod errors;
mod fluent_policy;
mod grouped;
mod intent_policy;
mod order;
mod plan_shape;
mod symbols;
#[cfg(test)]
mod tests;
pub(crate) use core::{validate_group_query_semantics, validate_query_semantics};
pub(crate) use cursor_policy::validate_cursor_order_plan_shape;
#[cfg(test)]
pub(crate) use cursor_policy::validate_cursor_paging_requirements;
pub use errors::PlanError;
pub(crate) use errors::{
CursorOrderPlanShapeError, FluentLoadPolicyViolation, IntentKeyAccessKind,
IntentKeyAccessPolicyViolation,
};
pub(crate) use errors::{
CursorPagingPolicyError, ExprPlanError, GroupPlanError, OrderPlanError, PolicyPlanError,
};
#[cfg(test)]
pub(crate) use errors::{PlanPolicyError, PlanUserError};
pub(crate) use fluent_policy::{validate_fluent_non_paged_mode, validate_fluent_paged_mode};
#[cfg(test)]
pub(in crate::db::query) use grouped::validate_group_projection_expr_compatibility;
pub(crate) use intent_policy::{validate_intent_key_access_policy, validate_intent_plan_shape};
pub(crate) use order::validate_order;
pub(crate) use plan_shape::{has_explicit_order, validate_order_shape, validate_plan_shape};
pub(in crate::db::query::plan::validate) use symbols::resolve_group_aggregate_target_field_type;
pub(crate) use symbols::{resolve_aggregate_target_field_slot, resolve_group_field_slot};
#[cfg(test)]
pub(crate) fn validate_group_cursor_constraints_for_tests(
logical: &crate::db::query::plan::ScalarPlan,
group: &crate::db::query::plan::GroupSpec,
) -> Result<(), PlanError> {
grouped::validate_group_cursor_constraints(logical, group)
}
#[cfg(test)]
pub(crate) fn validate_group_policy_for_tests(
schema: &crate::db::schema::SchemaInfo,
logical: &crate::db::query::plan::ScalarPlan,
group: &crate::db::query::plan::GroupSpec,
having: Option<&crate::db::query::plan::GroupHavingSpec>,
) -> Result<(), PlanError> {
grouped::validate_group_policy(schema, logical, group, having)
}
#[cfg(test)]
pub(crate) fn validate_group_structure_for_tests(
schema: &crate::db::schema::SchemaInfo,
model: &crate::model::entity::EntityModel,
group: &crate::db::query::plan::GroupSpec,
projection: &crate::db::query::plan::expr::ProjectionSpec,
having: Option<&crate::db::query::plan::GroupHavingSpec>,
) -> Result<(), PlanError> {
grouped::validate_group_structure(schema, model, group, projection, having)
}
#[cfg(test)]
pub(crate) fn validate_projection_expr_types_for_tests(
schema: &crate::db::schema::SchemaInfo,
projection: &crate::db::query::plan::expr::ProjectionSpec,
) -> Result<(), PlanError> {
grouped::validate_projection_expr_types(schema, projection)
}