athena_rs 3.26.2

Hyper performant polyglot Database driver
Documentation
//! Relation contract rows for schema catalog queries.
//!
//! This module owns relation-row contract shape and helper behavior used by
//! schema catalog and `/debug/schema` report composition.

use serde::{Deserialize, Serialize};

/// Relation metadata read from `information_schema.tables`.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SchemaRelationRecord {
    /// Schema that owns the relation.
    pub table_schema: String,
    /// Relation name.
    pub table_name: String,
    /// Relation type from `information_schema.tables.table_type`.
    pub relation_type: String,
}

/// Utility methods for relation-record key handling.
impl SchemaRelationRecord {
    /// Returns a deterministic `schema.table` key.
    pub fn key(&self) -> String {
        format!("{}.{}", self.table_schema.trim(), self.table_name.trim())
    }
}