uqa_sql/plan/
optimization.rs1use super::UnifiedPlan;
10use crate::{binding::statements::AnalyzedResult, SQLError, SQLParam};
11
12pub trait ExecutablePlanOptimizer {
14 fn plan_for_statement_cache(
17 &self,
18 plan: UnifiedPlan,
19 params: &[SQLParam],
20 ) -> Result<(UnifiedPlan, bool), SQLError> {
21 self.plan_for_execution(plan, params)
22 .map(|plan| (plan, false))
23 }
24
25 fn plan_for_execution(
26 &self,
27 plan: UnifiedPlan,
28 params: &[SQLParam],
29 ) -> Result<UnifiedPlan, SQLError>;
30
31 fn plan_with_result(
33 &self,
34 plan: UnifiedPlan,
35 params: &[SQLParam],
36 ) -> Result<(UnifiedPlan, AnalyzedResult), SQLError>;
37}