pub fn pg(n: usize, s: &str) -> Result<Addr<SqlActor>, Error> {
        #[cfg(feature = "postgres")]
        {
            let manager = ConnectionManager::<PgConnection>::new(s);
            let pool = Pool::builder().build(manager)?;

            let addr = SyncArbiter::start(n, move || SqlActor(SqlPool::PgPool(pool.clone())));
            Ok(addr)
        }

        #[cfg(not(feature = "postgres"))]
        {
            let _ = n;
            let _ = s;
            warn!("PostgreSQL support not enabled!");
            Err(SqlIdentityError::SqlVariantNotSupported.into())
        }
    }
/// Creates a new PostgresSQL Actor, for a connection to a PostgresSQL database
///
/// # Arguments
///
/// * `n` - Number of threads
/// * `s` - PostgresSQL connection string
Creates a new PostgresSQL Actor, for a connection to a PostgresSQL database
Creates a new PostgresSQL Actor for a connection to a PostgresSQL database
pub fn pg(n: usize, s: &str) -> Result<Addr<SqlActor>, Error> {
        #[cfg(feature = "postgres")]
        {
            let manager = ConnectionManager::<PgConnection>::new(s);
            let pool = Pool::builder().build(manager)?;
            let addr = SyncArbiter::start(n, move || SqlActor(SqlPool::PgPool(pool.clone())));
            Ok(addr)
        }
        #[cfg(not(feature = "postgres"))]
        {
            let _ = n;
            let _ = s;
            warn!("PostgreSQL support not enabled!");
            Err(SqlIdentityError::SqlVariantNotSupported.into())
        }
    }
pub fn pg ( n : usize , s : & str ) -> Result < Addr < SqlActor > , Error > { # [ cfg ( feature " " ) ] { let manager = ConnectionManager :: < PgConnection > :: new ( s ) ; let pool = Pool :: builder ( ) . build ( manager ) ? ; let addr = SyncArbiter :: start ( n , move | | SqlActor ( SqlPool :: PgPool ( pool . clone ( ) ) ) ) ; Ok ( addr ) } # [ cfg ( not ( feature " " ) ) ] { let _ = n ; let _ = s ; warn ! ( " " ) ; Err ( SqlIdentityError :: SqlVariantNotSupported . into ( ) ) } }
Creates a new PostgresSQL Actor, for a connection to a PostgresSQL database
Creates a new PostgresSQL Actor for a connection to a PostgresSQL database
n
usize
s
&str
n
usize
s
&str