pub async fn client(host: &str, port: u16) -> Result<Client> {
    let (mz_client, conn) = tokio_postgres::Config::new()
        .user("materialize")
        .host(host)
        .port(port)
        .connect(NoTls)
        .await?;

    // The connection object performs the actual communication with the database,
    // so spawn it off to run on its own.
    tokio::spawn(async move {
        if let Err(e) = conn.await {
            panic!("connection error: {}", e);
        }
    });

    Ok(mz_client)
}
/// Create and return a new PostgreSQL client, spawning off the connection
/// object along the way.
Create and return a new PostgreSQL client, spawning off the connection
object along the way.
Create and return a new PostgreSQL client spawning off the connection object along the way .
pub async fn client(host: &str, port: u16) -> Result<Client> {
    let (mz_client, conn) = tokio_postgres::Config::new()
        .user("materialize")
        .host(host)
        .port(port)
        .connect(NoTls)
        .await?;
    // The connection object performs the actual communication with the database,
    // so spawn it off to run on its own.
    tokio::spawn(async move {
        if let Err(e) = conn.await {
            panic!("connection error: {}", e);
        }
    });
    Ok(mz_client)
}
pub async fn client ( host : & str , port : u16 ) -> Result < Client > { let ( mz_client , conn ) = tokio_postgres :: Config :: new ( ) . user ( " " ) . host ( host ) . port ( port ) . connect ( NoTls ) . await ? ; // The connection object performs the actual communication with the database, // so spawn it off to run on its own. tokio :: spawn ( async move { if let Err ( e ) = conn . await { panic ! ( " " e ) ; } } ) ; Ok ( mz_client ) }
Create and return a new PostgreSQL client, spawning off the connection
object along the way.
Create and return a new PostgreSQL client spawning off the connection object along the way .
host
&str
port
u16
host
&str
port
u16