Skip to main content

uqa_engine/capabilities/
retrieval_catalog.rs

1//
2// Unified Query Algebra
3//
4// Copyright (c) 2023-2026 Cognica, Inc.
5//
6
7//! Read relation and text-index metadata from the active engine catalog.
8
9use crate::Engine;
10use uqa_sql::{semantics::text_indexes::TextMatchCatalog, SQLError};
11
12impl TextMatchCatalog for Engine {
13    fn has_table(&self, table: &str) -> Result<bool, String> {
14        self.try_query_has_table(table)
15            .map_err(|error| error.to_string())
16    }
17    fn has_column(&self, table: &str, column: &str) -> Result<bool, String> {
18        self.try_query_table_has_column(table, column)
19            .map_err(|error| error.to_string())
20    }
21    fn column_names(&self, table: &str) -> Result<Vec<String>, String> {
22        self.try_query_table_columns(table)
23            .map_err(|error| error.to_string())
24    }
25    fn indexed_fields(&self, table: &str) -> Result<Vec<String>, SQLError> {
26        self.fts_fields_for_table(table)
27    }
28}