Skip to main content

uqa_sql/schema/
declarations.rs

1//
2// Unified Query Algebra
3//
4// Copyright (c) 2023-2026 Cognica, Inc.
5//
6
7//! Declaration validation and binding for stored schema expressions.
8
9use crate::{
10    ast::{ColumnDef, FunctionVolatility},
11    SQLError,
12};
13use crate::{expr::EngineHook, semantics::sets::SetFunctionCatalog};
14
15/// Definition lookup for generated columns and immutable index expressions.
16pub trait SchemaExpressionCatalog: EngineHook + SetFunctionCatalog {
17    fn registered_runtime_function_volatility(&self, name: &str) -> Option<FunctionVolatility>;
18    fn schema_expression_columns(&self, table: &str) -> Result<Option<Vec<ColumnDef>>, SQLError>;
19}
20
21/// Routine metadata and immutable namespace inputs for schema expression binding.
22pub struct SchemaBindingContext<'a, 'q> {
23    pub catalog: &'a dyn SchemaExpressionCatalog,
24    pub binding: &'a crate::binding::context::BindingContext<'q>,
25}