1
#![allow(unused_imports)]
2
use crate::constants;
3
/// Integration tests for the migrations feature of `Canyon-SQL`
4
use canyon_sql::crud::Transaction;
5
#[cfg(feature = "migrations")]
6
use canyon_sql::migrations::handler::Migrations;
7

            
8
/// Brings the information of the `PostgreSQL` requested schema
9
#[cfg(all(feature = "postgres", feature = "migrations"))]
10
18
#[canyon_sql::macros::canyon_tokio_test]
11
1
fn test_migrations_postgresql_status_query() {
12
3
    let results = Migrations::query(constants::FETCH_PUBLIC_SCHEMA, [], constants::PSQL_DS).await;
13
1
    assert!(results.is_ok());
14

            
15
1
    let res = results.unwrap();
16
1
    let public_schema_info = res.get_postgres_rows();
17
1
    let first_result = public_schema_info.get(0).unwrap();
18

            
19
1
    assert_eq!(first_result.columns().get(0).unwrap().name(), "table_name");
20
1
    assert_eq!(
21
1
        first_result.columns().get(0).unwrap().type_().name(),
22
        "name"
23
    );
24
1
    assert_eq!(first_result.columns().get(0).unwrap().type_().oid(), 19);
25
1
    assert_eq!(
26
1
        first_result.columns().get(0).unwrap().type_().schema(),
27
        "pg_catalog"
28
    );
29
}