pg_extras

Function db_settings

Source
pub async fn db_settings(
    pool: &Pool<Postgres>,
) -> Result<Vec<DbSettings>, PgExtrasError>
Examples found in repository?
examples/db_settings.rs (line 12)
4
5
6
7
8
9
10
11
12
13
14
15
16
async fn main() -> Result<(), PgExtrasError> {
    std::env::set_var(
        "PG_EXTRAS_DATABASE_URL",
        "postgres://postgres:secret@localhost:5432/pg-extras-rs-test",
    );

    let pool = pg_pool().await?;

    let settings = db_settings(&pool).await?;
    render_table(settings);

    Ok(())
}