athena_rs 3.26.2

Hyper performant polyglot Database driver
Documentation
//! Column-row snapshot query helpers for `/debug/schema`.
//!
//! This module owns column fetch execution for logging-schema diagnostics
//! snapshot assembly while delegating SQL-error mapping to
//! `debug_snapshot_query_error_mapper`.

use sqlx::postgres::PgPool;

use super::debug_snapshot_error::LoggingSchemaSnapshotError;
use super::debug_snapshot_query_error_mapper::map_snapshot_columns_fetch_error;
use super::service::{SchemaColumnRecord, fetch_columns};

/// Fetches non-system column rows for logging schema diagnostics.
pub(super) async fn fetch_logging_schema_snapshot_columns(
    pool: &PgPool,
) -> Result<Vec<SchemaColumnRecord>, LoggingSchemaSnapshotError> {
    fetch_columns(pool, None, None, true)
        .await
        .map_err(map_snapshot_columns_fetch_error)
}