Function postgres_es::default_postgress_pool
source · [−]pub async fn default_postgress_pool(connection_string: &str) -> Pool<Postgres>
Expand description
A convenience method for building a simple connection pool for PostgresDb. A connection pool is needed for both the event and view repositories.
use sqlx::{Pool, Postgres};
use postgres_es::default_postgress_pool;
let connection_string = "postgresql://test_user:test_pass@localhost:5432/test";
let pool: Pool<Postgres> = default_postgress_pool(connection_string).await;