pub struct ConnectionPool { /* private fields */ }Expand description
Connection pool for PostgreSQL/PostGIS
Implementations§
Source§impl ConnectionPool
impl ConnectionPool
Sourcepub fn new(config: ConnectionConfig) -> Result<Self>
pub fn new(config: ConnectionConfig) -> Result<Self>
Creates a new connection pool
Sourcepub fn with_pool_config(
config: ConnectionConfig,
pool_config: PoolConfig,
) -> Result<Self>
pub fn with_pool_config( config: ConnectionConfig, pool_config: PoolConfig, ) -> Result<Self>
Creates a new connection pool with custom pool configuration
Sourcepub fn from_connection_string(conn_str: &str) -> Result<Self>
pub fn from_connection_string(conn_str: &str) -> Result<Self>
Creates a connection pool from a connection string
Sourcepub fn status(&self) -> PoolStatus
pub fn status(&self) -> PoolStatus
Gets the pool status
Sourcepub async fn check_postgis(&self) -> Result<bool>
pub async fn check_postgis(&self) -> Result<bool>
Checks if PostGIS extension is installed
Sourcepub async fn postgis_version(&self) -> Result<String>
pub async fn postgis_version(&self) -> Result<String>
Checks the PostGIS version
Sourcepub async fn health_check(&self) -> Result<HealthCheckResult>
pub async fn health_check(&self) -> Result<HealthCheckResult>
Performs a health check on the connection pool
Sourcepub const fn config(&self) -> &ConnectionConfig
pub const fn config(&self) -> &ConnectionConfig
Returns the connection configuration
Auto Trait Implementations§
impl Freeze for ConnectionPool
impl !RefUnwindSafe for ConnectionPool
impl Send for ConnectionPool
impl Sync for ConnectionPool
impl Unpin for ConnectionPool
impl UnsafeUnpin for ConnectionPool
impl !UnwindSafe for ConnectionPool
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more