Struct sqlx_postgres::PgDatabaseError
source · pub struct PgDatabaseError(/* private fields */);
Expand description
An error returned from the PostgreSQL database.
Implementations§
source§impl PgDatabaseError
impl PgDatabaseError
pub fn severity(&self) -> PgSeverity
sourcepub fn message(&self) -> &str
pub fn message(&self) -> &str
The primary human-readable error message. This should be accurate but terse (typically one line).
sourcepub fn detail(&self) -> Option<&str>
pub fn detail(&self) -> Option<&str>
An optional secondary error message carrying more detail about the problem. Might run to multiple lines.
sourcepub fn hint(&self) -> Option<&str>
pub fn hint(&self) -> Option<&str>
An optional suggestion what to do about the problem. This is intended to differ from
detail
in that it offers advice (potentially inappropriate) rather than hard facts.
Might run to multiple lines.
sourcepub fn position(&self) -> Option<PgErrorPosition<'_>>
pub fn position(&self) -> Option<PgErrorPosition<'_>>
Indicates an error cursor position as an index into the original query string; or, a position into an internally generated query.
sourcepub fn where(&self) -> Option<&str>
pub fn where(&self) -> Option<&str>
An indication of the context in which the error occurred. Presently this includes a call stack traceback of active procedural language functions and internally-generated queries. The trace is one entry per line, most recent first.
sourcepub fn schema(&self) -> Option<&str>
pub fn schema(&self) -> Option<&str>
If this error is with a specific database object, the name of the schema containing that object, if any.
sourcepub fn table(&self) -> Option<&str>
pub fn table(&self) -> Option<&str>
If this error is with a specific table, the name of the table.
sourcepub fn column(&self) -> Option<&str>
pub fn column(&self) -> Option<&str>
If the error is with a specific table column, the name of the column.
sourcepub fn data_type(&self) -> Option<&str>
pub fn data_type(&self) -> Option<&str>
If the error is with a specific data type, the name of the data type.
sourcepub fn constraint(&self) -> Option<&str>
pub fn constraint(&self) -> Option<&str>
If the error is with a specific constraint, the name of the constraint. For this purpose, indexes are constraints, even if they weren’t created with constraint syntax.
sourcepub fn file(&self) -> Option<&str>
pub fn file(&self) -> Option<&str>
The file name of the source-code location where this error was reported.
Trait Implementations§
source§impl DatabaseError for PgDatabaseError
impl DatabaseError for PgDatabaseError
source§fn constraint(&self) -> Option<&str>
fn constraint(&self) -> Option<&str>
source§fn table(&self) -> Option<&str>
fn table(&self) -> Option<&str>
source§fn is_unique_violation(&self) -> bool
fn is_unique_violation(&self) -> bool
source§fn is_foreign_key_violation(&self) -> bool
fn is_foreign_key_violation(&self) -> bool
source§fn is_check_violation(&self) -> bool
fn is_check_violation(&self) -> bool
source§impl Debug for PgDatabaseError
impl Debug for PgDatabaseError
source§impl Display for PgDatabaseError
impl Display for PgDatabaseError
source§impl Error for PgDatabaseError
impl Error for PgDatabaseError
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
Auto Trait Implementations§
impl !Freeze for PgDatabaseError
impl RefUnwindSafe for PgDatabaseError
impl Send for PgDatabaseError
impl Sync for PgDatabaseError
impl Unpin for PgDatabaseError
impl UnwindSafe for PgDatabaseError
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> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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