use sqlx::postgres::PgPool;
use super::debug_snapshot_contracts::LoggingSchemaSnapshot;
use super::debug_snapshot_error::LoggingSchemaSnapshotError;
use super::debug_snapshot_from_stage_output_assembly::build_logging_schema_snapshot_result_from_stage_output_assembly;
use super::debug_snapshot_queries::fetch_logging_schema_snapshot_rows;
use super::debug_snapshot_stage_input_assembly::build_debug_snapshot_stage_input_assembly;
use super::debug_snapshot_stage_output_assembly::build_debug_snapshot_stage_output_assembly;
pub(super) async fn fetch_logging_schema_snapshot(
pool: &PgPool,
) -> Result<LoggingSchemaSnapshot, LoggingSchemaSnapshotError> {
let stage_input =
build_debug_snapshot_stage_input_assembly(fetch_logging_schema_snapshot_rows(pool).await);
let stage = build_debug_snapshot_stage_output_assembly(stage_input);
build_logging_schema_snapshot_result_from_stage_output_assembly(stage)
}