athena_rs 3.18.0

Hyper performant polyglot Database driver
Documentation
//! `/schema` response payload mapping helpers.
//!
//! This module maps validated schema/catalog rows into the overview response
//! payload shape.

use super::super::presentation_overview_tables::build_schema_overview_tables;
use super::super::response_contracts::SchemaOverview;
use super::super::service::{SchemaColumnRecord, SchemaRelationRecord};

/// Builds the `/schema` payload for a schema name and discovered catalog records.
pub(in super::super) fn schema_overview(
    schema_name: String,
    relations: Vec<SchemaRelationRecord>,
    columns: Vec<SchemaColumnRecord>,
) -> SchemaOverview {
    SchemaOverview {
        schema_name,
        tables: build_schema_overview_tables(relations, columns),
    }
}