pub enum DbError {
Show 30 variants
Parse(String),
Semantic(String),
Execution(String),
Storage(String),
Deadlock(String),
Custom {
class: u8,
number: i32,
message: String,
},
SchemaNotFound {
schema: String,
},
TableNotFound {
schema: String,
table: String,
},
ColumnNotFound {
column: String,
},
ColumnNotFoundQualified {
table: String,
column: String,
},
TypeMismatch {
expected: String,
found: String,
},
IndexNotFound {
table: String,
index: String,
},
PrimaryKeyNotFound {
table: String,
},
ConstraintNotFound {
table: String,
constraint: String,
},
DatabaseNotFound {
database: String,
},
ObjectNotFound {
object: String,
},
DuplicateColumn {
column: String,
},
DuplicateTable {
schema: String,
table: String,
},
InvalidIdentifier {
identifier: String,
},
TriggerNotFound {
schema: String,
trigger: String,
},
DuplicateTrigger {
schema: String,
trigger: String,
},
ViewNotFound {
schema: String,
view: String,
},
DuplicateView {
schema: String,
view: String,
},
TypeNotFound {
schema: String,
type_name: String,
},
DuplicateType {
schema: String,
type_name: String,
},
DuplicateSchema {
schema: String,
},
CursorNotDeclared {
cursor: String,
},
CursorHasNoQuery {
cursor: String,
},
DivideByZero,
ConversionFailed {
from_type: String,
value: String,
to_type: String,
},
}Variants§
Parse(String)
Semantic(String)
Execution(String)
Storage(String)
Deadlock(String)
Custom
A custom error with an explicit SQL Server–style class and number. Allows callers to raise domain-specific errors (e.g. timeout, permission) without modifying the DbError enum itself.
SchemaNotFound
TableNotFound
ColumnNotFound
ColumnNotFoundQualified
TypeMismatch
IndexNotFound
PrimaryKeyNotFound
ConstraintNotFound
DatabaseNotFound
ObjectNotFound
DuplicateColumn
DuplicateTable
InvalidIdentifier
TriggerNotFound
DuplicateTrigger
ViewNotFound
DuplicateView
TypeNotFound
DuplicateType
DuplicateSchema
CursorNotDeclared
CursorHasNoQuery
DivideByZero
ConversionFailed
Implementations§
Source§impl DbError
impl DbError
pub fn class(&self) -> ErrorClass
pub fn class_severity(&self) -> u8
pub fn number(&self) -> i32
pub fn code(&self) -> &'static str
pub fn schema_not_found(schema: impl Into<String>) -> Self
pub fn table_not_found( schema: impl Into<String>, table: impl Into<String>, ) -> Self
pub fn column_not_found(column: impl Into<String>) -> Self
pub fn column_not_found_qualified( table: impl Into<String>, column: impl Into<String>, ) -> Self
pub fn type_mismatch( expected: impl Into<String>, found: impl Into<String>, ) -> Self
pub fn index_not_found( table: impl Into<String>, index: impl Into<String>, ) -> Self
pub fn primary_key_not_found(table: impl Into<String>) -> Self
pub fn constraint_not_found( table: impl Into<String>, constraint: impl Into<String>, ) -> Self
pub fn database_not_found(database: impl Into<String>) -> Self
pub fn object_not_found(object: impl Into<String>) -> Self
pub fn duplicate_column(column: impl Into<String>) -> Self
pub fn duplicate_table( schema: impl Into<String>, table: impl Into<String>, ) -> Self
pub fn invalid_identifier(identifier: impl Into<String>) -> Self
pub fn trigger_not_found( schema: impl Into<String>, trigger: impl Into<String>, ) -> Self
pub fn duplicate_trigger( schema: impl Into<String>, trigger: impl Into<String>, ) -> Self
pub fn view_not_found( schema: impl Into<String>, view: impl Into<String>, ) -> Self
pub fn duplicate_view( schema: impl Into<String>, view: impl Into<String>, ) -> Self
pub fn type_not_found( schema: impl Into<String>, type_name: impl Into<String>, ) -> Self
pub fn duplicate_type( schema: impl Into<String>, type_name: impl Into<String>, ) -> Self
pub fn duplicate_schema(schema: impl Into<String>) -> Self
pub fn cursor_not_declared(cursor: impl Into<String>) -> Self
pub fn cursor_has_no_query(cursor: impl Into<String>) -> Self
pub fn divide_by_zero() -> Self
pub fn conversion_failed( from_type: impl Into<String>, value: impl Into<String>, to_type: impl Into<String>, ) -> Self
Trait Implementations§
Source§impl Error for DbError
impl Error for DbError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for DbError
impl RefUnwindSafe for DbError
impl Send for DbError
impl Sync for DbError
impl Unpin for DbError
impl UnsafeUnpin for DbError
impl UnwindSafe for DbError
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