Function af_postgres::connect[][src]

pub async fn connect(config: &Config) -> Result<(Client, Task<Result>)>

Connects to a Postgres database using the given config.

This function returns a tuple with a Client and a connection task. The task must be polled (for example, by adding it to a [Batch][af_core::task::Batch]) to communicate with the server and report errors. The client can be cloned and shared between tasks.