# Connect in db_sqlx_postgres::dev - Rust
Create database connection

# Trait db_sqlx_postgres::dev::Connect

source ·

    pub trait Connect {
        type Pool: MCDatabase;

        // Required method
        fn connect<'async_trait>(
            self
        ) -> Pin<Box<dyn Future<Output = Result<Self::Pool, DBError>> + Send + 'async_trait>>
           where Self: 'async_trait;
    }

Expand description

Create database connection

## Required Associated Types§

source

#### type Pool: MCDatabase

database specific pool-type

## Required Methods§

source

#### fn connect<'async_trait>( self ) -> Pin<Box<dyn Future<Output = Result<Self::Pool, DBError>> + Send + 'async_trait>>
where Self: 'async_trait,

database specific error-type create connection pool

## Implementors§

source §

### impl Connect for ConnectionOptions

§

#### type Pool = Database