use sqlx::postgres::PgPool;
use super::debug_snapshot_contracts::LoggingSchemaSnapshotRows;
use super::debug_snapshot_error::LoggingSchemaSnapshotError;
use super::debug_snapshot_queries_from_stage_output_assembly::build_logging_schema_snapshot_rows_result_from_stage_output_assembly;
use super::debug_snapshot_queries_stage_input_assembly::build_debug_snapshot_queries_stage_input_assembly;
use super::debug_snapshot_queries_stage_input_contracts::LoggingSchemaSnapshotRowsStageInput;
use super::debug_snapshot_queries_stage_output_assembly::build_debug_snapshot_queries_stage_output_assembly;
use super::debug_snapshot_query_columns::fetch_logging_schema_snapshot_columns;
use super::debug_snapshot_query_relations::fetch_logging_schema_snapshot_relations;
pub(super) async fn fetch_logging_schema_snapshot_rows(
pool: &PgPool,
) -> Result<LoggingSchemaSnapshotRows, LoggingSchemaSnapshotError> {
let stage_input: LoggingSchemaSnapshotRowsStageInput =
build_debug_snapshot_queries_stage_input_assembly(
fetch_logging_schema_snapshot_relations(pool).await,
fetch_logging_schema_snapshot_columns(pool).await,
);
let stage = build_debug_snapshot_queries_stage_output_assembly(stage_input);
build_logging_schema_snapshot_rows_result_from_stage_output_assembly(stage)
}