pub fn new(pool_max_size: Option<u32>) -> Self {
        let database_url = Self::get_database_url();
        let max_size = pool_max_size.unwrap_or_else(|| parse_env("DB_POOL_SIZE"));
        let manager = ConnectionManager::<RecoverableConnection<PgConnection>>::new(database_url);
        let pool = Pool::builder()
            .max_size(max_size)
            .build(manager)
            .expect("Failed to create connection pool");

        Self { pool }
    }
/// Establishes a pool of the connections to the database and
/// creates a new `ConnectionPool` object.
/// pool_max_size - number of connections in pool, if not set env variable "DB_POOL_SIZE" is going to be used.
Establishes a pool of the connections to the database and
creates a new `ConnectionPool` object.
pool_max_size - number of connections in pool, if not set env variable "DB_POOL_SIZE" is going to be used.
Establishes a pool of the connections to the database and creates a new ` ConnectionPool ` object . pool_max_size - number of connections in pool if not set env variable " DB_POOL_SIZE " is going to be used .
pub fn new(pool_max_size: Option<u32>) -> Self {
        let database_url = Self::get_database_url();
        let max_size = pool_max_size.unwrap_or_else(|| parse_env("DB_POOL_SIZE"));
        let manager = ConnectionManager::<RecoverableConnection<PgConnection>>::new(database_url);
        let pool = Pool::builder()
            .max_size(max_size)
            .build(manager)
            .expect("Failed to create connection pool");
        Self { pool }
    }
pub fn new ( pool_max_size : Option < u32 > ) -> Self { let database_url = Self :: get_database_url ( ) ; let max_size = pool_max_size . unwrap_or_else ( | | parse_env ( " " ) ) ; let manager = ConnectionManager :: < RecoverableConnection < PgConnection > > :: new ( database_url ) ; let pool = Pool :: builder ( ) . max_size ( max_size ) . build ( manager ) . expect ( " " ) ; Self { pool } }
Establishes a pool of the connections to the database and
creates a new `ConnectionPool` object.
Establishes a pool of the connections to the database and creates a new ` ConnectionPool ` object .
pool_max_size
Option<u32>