uqa_execution/query/scope/production/
ctes.rs1use crate::query::{cte::rows::CteRows, CteScope};
8use uqa_core::memory::ProductionControl;
9use uqa_sql::{plan::CtePlan, SQLError};
10
11impl<S: Clone> CteScope<S> {
12 pub fn materialized_for_scan_with_control(
13 &self,
14 reference: &str,
15 control: &ProductionControl<'_>,
16 ) -> Result<Option<CteRows>, SQLError> {
17 control.check()?;
18 let rows = self.materialized_for_scan(reference);
19 control.check()?;
20 Ok(rows)
21 }
22 pub fn deferred_reference_with_control(
23 &self,
24 reference: &str,
25 control: &ProductionControl<'_>,
26 ) -> Result<Option<&CtePlan>, SQLError> {
27 control.check()?;
28 let plan = self.deferred_reference(reference);
29 control.check()?;
30 Ok(plan)
31 }
32 pub fn is_visible_cte_with_control(
33 &self,
34 reference: &str,
35 control: &ProductionControl<'_>,
36 ) -> Result<bool, SQLError> {
37 control.check()?;
38 let visible = self.is_visible_cte(reference);
39 control.check()?;
40 Ok(visible)
41 }
42}