uqa_sql/prepared/planning.rs
1//
2// Unified Query Algebra
3//
4// Copyright (c) 2023-2026 Cognica, Inc.
5//
6
7//! Prepared-plan selection contract and identity-checked cache updates.
8
9use crate::{plan::UnifiedPlan, SQLError, SQLParam};
10
11pub trait PreparedPlanProvider {
12 fn plan_for_execution(
13 &self,
14 name: &str,
15 parameters: &[SQLParam],
16 ) -> Result<Option<UnifiedPlan>, SQLError>;
17}
18
19pub struct PreparedPlanUpdate {
20 pub generic_plan: Option<UnifiedPlan>,
21 pub generic_cost: Option<f64>,
22 pub custom_cost: Option<f64>,
23}