pub enum Error {
Sql(Error),
Migration(MigrateError),
InvalidDbUrl(String),
DatabaseNotLoaded(String),
UnsupportedDatatype(String),
}Expand description
Errors that can happen while connecting to a database, running migrations or executing a query.
Serializes to its std::fmt::Display representation, which is what the
frontend receives when a command fails.
Variants§
Sql(Error)
An error reported by sqlx, such as a failed connection or a query the database rejected.
Migration(MigrateError)
A migration registered with crate::Builder::add_migrations could not be resolved or applied.
InvalidDbUrl(String)
The connection string is missing its scheme: prefix, or the scheme does not
match any of the enabled database drivers. Contains the offending connection string.
DatabaseNotLoaded(String)
The requested database has not been connected to with the load command
and is not listed in the plugin’s preload configuration.
Contains the connection string of the database.
UnsupportedDatatype(String)
A value selected from the database has a SQL type that cannot be converted to JSON. Contains the name of that SQL type.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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<MigrateError> for Error
impl From<MigrateError> for Error
Source§fn from(source: MigrateError) -> Self
fn from(source: MigrateError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Freeze for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
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