athena_rs 3.23.0

Hyper performant polyglot Database driver
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Migration row-to-contract mapping helpers for schema service queries.
//!
//! This module converts raw SQLx rows for migration-table queries into schema
//! migration contracts.

use sqlx::{Row, postgres::PgRow};

use super::service_contracts::SchemaMigrationRecord;

/// Maps migration-query rows into migration contract records.
pub(super) fn map_migration_rows(rows: Vec<PgRow>) -> Vec<SchemaMigrationRecord> {
    rows.into_iter()
        .map(|row| SchemaMigrationRecord {
            version: row.get("version"),
            name: row.get("name"),
        })
        .collect()
}