Skip to main content

uqa_sql/binding/
context.rs

1//
2// Unified Query Algebra
3//
4// Copyright (c) 2023-2026 Cognica, Inc.
5//
6
7//! Immutable SQL inputs adapted from the active statement scope.
8
9use crate::catalog::{analysis::CatalogReadView, resolution::RelationNameResolution};
10use crate::{
11    plan::{CtePlan, QueryPlan},
12    RowSchema,
13};
14use std::collections::{BTreeMap, BTreeSet};
15
16#[derive(Clone)]
17pub struct BindingContext<'a> {
18    pub catalog: CatalogReadView,
19    pub resolution: RelationNameResolution,
20    pub ctes: BTreeMap<String, RowSchema>,
21    pub deferred_ctes: BTreeMap<String, CtePlan>,
22    pub non_returning_ctes: BTreeSet<String>,
23    pub scalar_subqueries: &'a [QueryPlan],
24}