athena_rs 3.18.0

Hyper performant polyglot Database driver
Documentation
//! Shared `/debug/schema` snapshot-error test fixtures.
//!
//! These helpers centralize canonical `LoggingSchemaSnapshotError` variants so
//! response, service-result, and snapshot-query tests can reuse one source of
//! error-fixture shaping.

use super::debug_snapshot_error::LoggingSchemaSnapshotError;

/// Builds a `FetchRelations` snapshot error fixture with protocol source text.
#[cfg(test)]
pub(crate) fn build_fetch_relations_snapshot_error_for_tests(
    source_message: &str,
) -> LoggingSchemaSnapshotError {
    LoggingSchemaSnapshotError::FetchRelations(sqlx::Error::Protocol(source_message.to_string()))
}

/// Builds a `FetchColumns` snapshot error fixture with protocol source text.
#[cfg(test)]
pub(crate) fn build_fetch_columns_snapshot_error_for_tests(
    source_message: &str,
) -> LoggingSchemaSnapshotError {
    LoggingSchemaSnapshotError::FetchColumns(sqlx::Error::Protocol(source_message.to_string()))
}