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::{plan::QueryPlan, RowSchema};
11use std::collections::{BTreeMap, BTreeSet};
12
13#[derive(Clone)]
14pub struct BindingContext<'a> {
15    pub catalog: CatalogReadView,
16    pub resolution: RelationNameResolution,
17    pub ctes: BTreeMap<String, RowSchema>,
18    pub deferred_ctes: BTreeMap<String, crate::plan::RetainedCtePlan>,
19    pub non_returning_ctes: BTreeSet<String>,
20    pub scalar_subqueries: &'a [QueryPlan],
21}
22
23#[cfg(test)]
24mod tests;