athena_rs 3.26.2

Hyper performant polyglot Database driver
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Schema migration fetch execution helpers.
//!
//! This module owns direct execution of migration-table queries and row
//! mapping, isolated from general catalog relation/column fetch logic.

use sqlx::postgres::PgPool;

use super::service_contracts::SchemaMigrationRecord;
use super::service_queries::migrations_query;
use super::service_row_mapper::map_migration_rows;

/// Fetches Supabase-style migrations when the table exists.
pub async fn fetch_migrations(pool: &PgPool) -> Result<Vec<SchemaMigrationRecord>, sqlx::Error> {
    let rows = sqlx::query(migrations_query()).fetch_all(pool).await?;

    Ok(map_migration_rows(rows))
}