pub struct ConnectionManager { /* private fields */ }Expand description
Connection manager that handles pool creation and management
Implementations§
Source§impl ConnectionManager
impl ConnectionManager
Sourcepub async fn from_config(config: IgnisConfig) -> Result<Self>
pub async fn from_config(config: IgnisConfig) -> Result<Self>
Create a new connection manager from configuration
Sourcepub async fn new_default() -> Result<Self>
pub async fn new_default() -> Result<Self>
Create a connection manager with default configuration
Sourcepub async fn from_yaml_file(path: &str) -> Result<Self>
pub async fn from_yaml_file(path: &str) -> Result<Self>
Create a connection manager from YAML file
Sourcepub fn transaction_manager(&self) -> &Arc<TransactionManager>
pub fn transaction_manager(&self) -> &Arc<TransactionManager>
Get a reference to the transaction manager
Sourcepub fn config(&self) -> &IgnisConfig
pub fn config(&self) -> &IgnisConfig
Get a reference to the configuration
Sourcepub async fn health_check(&self) -> Result<bool>
pub async fn health_check(&self) -> Result<bool>
Check if the connection pool is healthy
Sourcepub async fn get_pool_stats(&self) -> Result<PoolStats>
pub async fn get_pool_stats(&self) -> Result<PoolStats>
Get connection pool statistics
Sourcepub async fn execute_query(&self, query: &str) -> Result<Vec<PgRow>>
pub async fn execute_query(&self, query: &str) -> Result<Vec<PgRow>>
Execute a query and return all results
Sourcepub async fn execute_query_one(&self, query: &str) -> Result<Option<PgRow>>
pub async fn execute_query_one(&self, query: &str) -> Result<Option<PgRow>>
Execute a query and return one result
Sourcepub async fn execute_command(&self, query: &str) -> Result<u64>
pub async fn execute_command(&self, query: &str) -> Result<u64>
Execute a command (INSERT, UPDATE, DELETE)
Sourcepub async fn benchmark_pool(
&self,
concurrent_queries: usize,
) -> Result<PoolBenchmarkResult>
pub async fn benchmark_pool( &self, concurrent_queries: usize, ) -> Result<PoolBenchmarkResult>
Test connection pool performance
Sourcepub async fn start_health_monitor(&self, interval: Duration) -> Result<()>
pub async fn start_health_monitor(&self, interval: Duration) -> Result<()>
Monitor pool health continuously
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ConnectionManager
impl !UnwindSafe for ConnectionManager
impl Freeze for ConnectionManager
impl Send for ConnectionManager
impl Sync for ConnectionManager
impl Unpin for ConnectionManager
impl UnsafeUnpin for ConnectionManager
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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more