Function postgres_backend

Source
pub async fn postgres_backend() -> Result<PostgresBackend, PostgresError>
Expand description

Create a new PostgreSQL backend from environment variables

This function can be used to create a backend that can be passed into with_database()

ยงExample

use testkit_postgres::postgres_backend;
use testkit_core::with_database;

async fn test() {
    let backend = postgres_backend().await.unwrap();
    let context = with_database(backend)
        .execute()
        .await
        .unwrap();
}