pub async fn make_pool(database_url: &str) -> Result<Pool<Postgres>, Error>Expand description
Connects to a PostgreSQL database URL and returns a tuned PgPool.
Respects environment configuration for pool tuning:
AZUMS_DB_MAX_CONNECTIONS: Max connection pool size (default:4, range1-32).AZUMS_DB_ACQUIRE_TIMEOUT_SECS: Connection acquire timeout in seconds (default:10s).AZUMS_DISABLE_JIT: Disables Postgres JIT compilation on new sessions (default:true).AZUMS_DISABLE_SYNC_COMMIT: Setssynchronous_commit = OFF(default:false).
ยงExamples
use azums::make_pool;
let pool = make_pool("postgres://postgres:postgres@localhost:5432/azums_dev").await?;