uqa-execution 0.4.6

Volcano physical operators with row-batch pipelines
//
// Unified Query Algebra
//
// Copyright (c) 2023-2026 Cognica, Inc.
//

//! Stable catalog identity and OID policy.

use uqa_core::RelationIdentity;
use uqa_sql::SQLError;

/// Resolve namespace references from the same catalog snapshot as their owning rows.
pub fn namespace_oid(catalog: &crate::catalog::CatalogReadView, name: &str) -> i64 {
    catalog
        .schema_security(name)
        .map_or_else(|| schema_oid(name), |security| security.namespace_oid(name))
}

pub fn split_schema_name(name: &str) -> Result<(String, String), SQLError> {
    let relation = RelationIdentity::from_legacy_name(name).map_err(|error| {
        SQLError::Internal(format!("invalid catalog relation `{name}`: {error}"))
    })?;
    Ok((relation.schema, relation.name))
}

pub use uqa_sql::catalog::oids::{
    current_user_name, current_user_oid, relation_oid, schema_oid, stable_object_oid, stable_oid,
};