athena_rs 3.26.4

Hyper performant polyglot Database driver
Documentation
//! Intermediate debug report component builder for `/debug/schema`.
//!
//! This module assembles staged diagnostics components from discovered relation
//! and column rows before final payload output shaping while summary
//! composition is delegated to `debug_report_components_summary` and
//! expected-table evaluation/still-needed aggregation is delegated to
//! `debug_report_components_evaluation_stage`. Observed-table stage composition
//! is delegated to `debug_report_components_observed_stage`. Builder-stage
//! observed-stage input assembly is delegated to
//! `debug_report_components_observed_stage_input_assembly`. Builder-stage
//! input assembly is delegated to
//! `debug_report_components_builder_stage_input_assembly`. Builder-stage
//! payload assembly is delegated to
//! `debug_report_components_builder_stage_output_assembly` and final staged
//! handoff is delegated to the stable facade in
//! `debug_report_components_from_builder_stage_output_assembly`, which
//! delegates to `debug_report_components_builder_stage_output_handoff_assembly`.
//! Typed builder-input contracts are provided by
//! `debug_report_components_builder_input_contracts` and typed builder-input
//! payload assembly is provided by
//! `debug_report_components_builder_input_assembly`.

use super::debug_report_components_builder_input_contracts::LoggingSchemaDebugReportComponentsBuilderInput;
use super::debug_report_components_builder_stage_input_assembly::build_debug_report_components_builder_stage_input_assembly;
use super::debug_report_components_builder_stage_input_contracts::LoggingSchemaDebugReportComponentsBuilderStageInput;
use super::debug_report_components_builder_stage_output_assembly::build_debug_report_components_builder_stage_output_assembly;
use super::debug_report_components_contracts::LoggingSchemaDebugReportComponents;
use super::debug_report_components_evaluation_stage::build_debug_report_components_evaluation_stage;
use super::debug_report_components_from_builder_stage_output_assembly::build_logging_schema_debug_report_components_from_builder_stage_output_assembly;
use super::debug_report_components_observed_stage::build_debug_report_components_observed_map;
use super::debug_report_components_observed_stage_input_assembly::build_debug_report_components_observed_stage_input_assembly;

/// Builds intermediate diagnostics parts from discovered relations and columns.
pub(super) fn build_logging_schema_debug_report_components(
    input: LoggingSchemaDebugReportComponentsBuilderInput,
) -> LoggingSchemaDebugReportComponents {
    let LoggingSchemaDebugReportComponentsBuilderInput { relations, columns } = input;
    let observed_stage_input =
        build_debug_report_components_observed_stage_input_assembly(relations, columns);
    let observed_map = build_debug_report_components_observed_map(observed_stage_input);
    let evaluation_stage = build_debug_report_components_evaluation_stage(&observed_map);
    let stage_input: LoggingSchemaDebugReportComponentsBuilderStageInput =
        build_debug_report_components_builder_stage_input_assembly(observed_map, evaluation_stage);
    let stage = build_debug_report_components_builder_stage_output_assembly(stage_input);

    build_logging_schema_debug_report_components_from_builder_stage_output_assembly(stage)
}