connect

Function connect 

Source
pub(crate) async fn connect(config: &PostgresConfig) -> Result<PgPool, Error>
Expand description

Creates and returns a PostgreSQL connection pool.

Connects to the database specified in config.url with the pool size limited to config.max_connections.

ยงErrors

Returns sqlx::Error if the database is unreachable or the connection string is malformed.