pub enum MigrationError {
CatalogTooNew {
found: u32,
supported: u32,
},
MissingStep {
from: u32,
to: u32,
},
Step {
from: u32,
to: u32,
name: &'static str,
source: Error,
},
Sqlite(Error),
}Expand description
Why a catalog could not be brought to SCHEMA_VERSION.
Variants§
CatalogTooNew
The catalog was written by a newer build than this one.
This is a refusal, not a downgrade. Forward-only settles the direction of migration; this settles what happens in the other direction. The catalog is left byte-for-byte untouched — no stamp rewrite, no DDL, no drop — because an older binary cannot know what invariants the newer schema added, and writing to it would corrupt a library the user’s current build can still open perfectly. The recovery is to update the app, which is always available; there is no recovery from silent divergent writes.
MissingStep
No step is registered out of from. Structurally impossible while
steps_form_a_contiguous_chain passes; kept so a gap fails loudly rather than looping.
Step
A step failed. The catalog is still stamped from: each step commits atomically, so a
failure rolls the whole step back and the next open retries it.
Sqlite(Error)
Trait Implementations§
Source§impl Debug for MigrationError
impl Debug for MigrationError
Source§impl Display for MigrationError
impl Display for MigrationError
Source§impl Error for MigrationError
impl Error for MigrationError
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<Error> for MigrationError
impl From<Error> for MigrationError
Source§impl From<MigrationError> for Error
impl From<MigrationError> for Error
Source§fn from(err: MigrationError) -> Self
fn from(err: MigrationError) -> Self
Flatten into the error type the catalog’s callers already handle.
crate::db::DatabaseDriver::open is consumed by capsule-core-ffi and
library::open through rusqlite::Error, so the migrator’s typed error is flattened
at that boundary rather than rippling a new error type through them. Callers that want
the typed error call DatabaseDriver::migrate.
Auto Trait Implementations§
impl !RefUnwindSafe for MigrationError
impl !UnwindSafe for MigrationError
impl Freeze for MigrationError
impl Send for MigrationError
impl Sync for MigrationError
impl Unpin for MigrationError
impl UnsafeUnpin for MigrationError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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