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.