1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//! Automatic reconnection, retry policies, and connection resilience.
//!
//! This module provides:
//!
//! - **Error classification**: [`ErrorClass`] and [`classify_error`] for categorizing
//! errors as Broken, Transient, or Permanent.
//! - **Reconnection configuration**: [`ReconnectConfig`] for controlling automatic
//! reconnection behavior.
//! - **Stale connection detection**: [`StaleConfig`] for proactive detection of
//! connections that may be broken.
//! - **Retry policy**: [`RetryPolicy`] for standalone retry with exponential backoff.
//! - **Session state tracking**: [`SessionState`] for tracking state that would be
//! lost on reconnection (prepared statements, LISTEN channels, GUCs).
//! - **Connection health**: [`ConnectionHealth`] for tracking connection liveness
//! and reconnection history.
//!
//! # Design Philosophy
//!
//! **Transparent reconnection is opt-in**. By default, broken connections return
//! errors. Users must explicitly enable reconnection via `Config::enable_reconnect()`
//! or connection string `reconnect=true`.
//!
//! **Retry policies are explicit**. The library provides retry helpers but does
//! not automatically retry queries. Users choose when and how to retry via
//! [`Connection::with_retry()`](crate::Connection::with_retry).
//!
//! **Mid-transaction reconnection is blocked by default**. If a connection breaks
//! mid-transaction, the transaction state is lost and the operation may have
//! partially completed. Set `allow_mid_transaction=true` to override this.
pub use ;
pub use ;
pub use RetryPolicy;
pub use ;