Skip to main content

uqa_sql/semantics/
constraint_catalog.rs

1//
2// Unified Query Algebra
3//
4// Copyright (c) 2023-2026 Cognica, Inc.
5//
6
7//! Read-only relation constraint declarations.
8use crate::{
9    ast::{ColumnType, ForeignKey, TableCheck},
10    SQLError,
11};
12pub trait ConstraintCatalog: super::conflict::ConflictCatalog {
13    fn try_unique_columns(&self, table: &str) -> Result<Vec<String>, String>;
14    fn try_check_constraint_definitions(&self, table: &str) -> Result<Vec<TableCheck>, String>;
15    fn try_foreign_keys(&self, table: &str) -> Result<Vec<ForeignKey>, String>;
16    fn column_type(&self, table: &str, column: &str) -> Result<Option<ColumnType>, String>;
17    fn hierarchy_scan_tables(
18        &self,
19        table: &str,
20        descendants: bool,
21    ) -> Result<Vec<String>, SQLError>;
22}