pub enum SQLError {
Show 15 variants
Parse(String),
Unsupported(String),
NotificationRequiresSubscription,
UnknownTable(String),
UnknownColumn(String),
AmbiguousColumn(String),
UnknownFunction(String),
TypeMismatch(String),
BadArity {
name: String,
expected: String,
actual: usize,
},
MissingParam(usize),
VectorDimMismatch {
expected: usize,
actual: usize,
},
Cancelled(QueryCancelled),
Routine {
sqlstate: String,
message: String,
},
Diagnostic {
sqlstate: String,
message: String,
detail: Option<String>,
hint: Option<String>,
},
Internal(String),
}Variants§
Parse(String)
Unsupported(String)
NotificationRequiresSubscription
The host configured this SQL session to require an independently owned notification subscription.
UnknownTable(String)
UnknownColumn(String)
AmbiguousColumn(String)
UnknownFunction(String)
TypeMismatch(String)
BadArity
MissingParam(usize)
VectorDimMismatch
Cancelled(QueryCancelled)
Routine
Error raised by (or on behalf of) a user-defined SQL /
PL/pgSQL routine. Carries an explicit SQLSTATE so
EXCEPTION WHEN <condition> handlers and SQLSTATE /
SQLERRM report the same code PostgreSQL would.
Diagnostic
A primary SQL error with separate PostgreSQL diagnostic fields. SQLERRM and Display expose only the primary message; protocol clients receive detail and hint independently.
Internal(String)
Implementations§
Source§impl SQLError
impl SQLError
Sourcepub const fn code(&self) -> Option<&'static str>
pub const fn code(&self) -> Option<&'static str>
Stable application error code, separate from the five-character SQLSTATE. Ordinary SQL errors do not acquire an application code.
Sourcepub fn undefined_function_call(signature: &str) -> Self
pub fn undefined_function_call(signature: &str) -> Self
ParseFuncOrColumn’s error when no function matches a call: signature is the name with its argument types, as func_signature_string spells it.
Sourcepub fn ambiguous_function_call(signature: &str) -> Self
pub fn ambiguous_function_call(signature: &str) -> Self
ParseFuncOrColumn’s error when more than one function matches a call equally well.
Sourcepub fn function_call_resolution(
sqlstate: &str,
signature: &str,
suffix: &str,
) -> Self
pub fn function_call_resolution( sqlstate: &str, signature: &str, suffix: &str, ) -> Self
A failed call resolution in ParseFuncOrColumn’s terms: 42883 when no function matches and 42725 when no candidate is best, each with its hint.
pub fn unknown_qualified_column(qualifier: &str, column: &str) -> Self
Sourcepub fn sqlstate(&self) -> Option<&str>
pub fn sqlstate(&self) -> Option<&str>
PostgreSQL SQLSTATE code for the error, mirroring the
the current exception-to-state mapping. None for
errors that do not carry a defined SQLSTATE.
Trait Implementations§
Source§impl Error for SQLError
impl Error for SQLError
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()
Source§impl From<&SQLError> for DeferredSQLError
impl From<&SQLError> for DeferredSQLError
Source§impl From<CatalogRetentionError> for SQLError
impl From<CatalogRetentionError> for SQLError
Source§fn from(error: CatalogRetentionError) -> Self
fn from(error: CatalogRetentionError) -> Self
Source§impl From<DeferredSQLError> for SQLError
impl From<DeferredSQLError> for SQLError
Source§fn from(error: DeferredSQLError) -> Self
fn from(error: DeferredSQLError) -> Self
Source§impl From<MemoryError> for SQLError
impl From<MemoryError> for SQLError
Source§fn from(error: MemoryError) -> Self
fn from(error: MemoryError) -> Self
Source§impl From<QueryCancelled> for SQLError
impl From<QueryCancelled> for SQLError
Source§fn from(source: QueryCancelled) -> Self
fn from(source: QueryCancelled) -> Self
Source§impl From<SQLError> for SequenceValueError
impl From<SQLError> for SequenceValueError
Source§impl From<ValueRetentionError> for SQLError
impl From<ValueRetentionError> for SQLError
Source§fn from(error: ValueRetentionError) -> Self
fn from(error: ValueRetentionError) -> Self
Auto Trait Implementations§
impl Freeze for SQLError
impl RefUnwindSafe for SQLError
impl Send for SQLError
impl Sync for SQLError
impl Unpin for SQLError
impl UnsafeUnpin for SQLError
impl UnwindSafe for SQLError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
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> ⓘ
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