pub enum SqlError {
Syntax(String),
Constraint(String),
Other(String),
Unavailable(String),
}Expand description
Why a SQL operation failed.
Variants§
Syntax(String)
The statement could not be parsed or planned.
Constraint(String)
A constraint (unique, type, foreign key, …) was violated.
Other(String)
Any other backend/transport error (I/O, connection, …).
The backend is not ready yet — a host-MANAGED database that is still starting,
recovering, or has no healthy replica (distinct from a permanent config/transport error).
This is transient: the caller should retry, or return a retryable 503 — never treat it
as a permanent “not configured”/“not granted” failure. Emitted only by the managed-compute
resolver; an external/local backend’s outages stay Other (per-DB
resilience, no readiness gate).
Implementations§
Source§impl SqlError
impl SqlError
Sourcepub fn other<E: Display>(err: E) -> Self
pub fn other<E: Display>(err: E) -> Self
Wrap any displayable error as SqlError::Other.
Wrap a displayable error as SqlError::Unavailable — a transient “managed backend not
ready yet” condition (still starting / recovering / no healthy replica).
Whether this is the transient Unavailable not-ready condition
(the caller may retry or gate with a retryable 503).
Trait Implementations§
Source§impl Error for SqlError
impl Error for SqlError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()