pub struct PgPool { /* private fields */ }Expand description
PostgreSQL connection pool for distributed coordination
Provides connection pooling for PostgreSQL operations. Connections are reused across operations for optimal performance.
Implementations§
Source§impl PgPool
impl PgPool
Sourcepub async fn from_config(config: &Config) -> Result<Self, PgError>
pub async fn from_config(config: &Config) -> Result<Self, PgError>
Create a new PostgreSQL connection pool from WarpDrive config
§Arguments
config- WarpDrive configuration with database_url
§Errors
Returns error if:
- No database_url configured
- Invalid connection string
- Cannot connect to database
§Example
let config = Config::from_env()?;
let pool = PgPool::from_config(&config).await?;Trait Implementations§
Auto Trait Implementations§
impl Freeze for PgPool
impl !RefUnwindSafe for PgPool
impl Send for PgPool
impl Sync for PgPool
impl Unpin for PgPool
impl !UnwindSafe for PgPool
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