Expand description
Retry helpers for transient database operations.
Three levels exist, from preferred to most specific:
- Multi-statement transactions:
crate::transaction::with_transaction_retryretries the whole transaction callback and classifies commit outcomes. This is the only retry level that is safe for transactions. - Idempotent single statements (reads, upserts, deletes by key):
with_sea_orm_retryandwith_sea_orm_retry_timeout. - Crate-internal
DbErrorworkflows such as connection setup:with_retry.
Every retryability decision derives from crate::database_error_kind and driver-native
error codes; error message text is never inspected. Non-retryable errors return
immediately so application bugs are not hidden behind sleep loops.
Structs§
- Retry
Config - Retry configuration for async database operations.
Functions§
- is_
retryable_ sea_ orm_ error - Returns whether a SeaORM error represents a transient database failure.
- with_
retry - Execute an async operation with exponential backoff retry
- with_
sea_ orm_ retry - Executes a SeaORM operation with shared transient-error classification and backoff.
- with_
sea_ orm_ retry_ timeout - Executes a SeaORM operation with retry and a timeout applied to every attempt.