Skip to main content

SeedError

Enum SeedError 

Source
#[non_exhaustive]
pub enum SeedError { CyclicForeignKeys { tables: Vec<String>, }, MissingParentRows { child: String, parent: String, }, UnsafeResetSelection { parent: String, skipped_child: String, }, ParameterLimitTooLow { table: String, required: usize, limit: usize, }, UnknownTable { table: String, known: Vec<String>, }, AmbiguousTable { table: String, candidates: Vec<String>, }, UnknownColumn { table: String, column: String, known: Vec<String>, }, NotRelated { parent: String, child: String, }, DialectNotEnabled { dialect: String, }, NoLiteral { reason: String, }, InvalidValue { table: String, column: String, reason: String, }, }
Expand description

Why SeedConfig could not build the statements (returned by try_generate and reset_plan).

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

CyclicForeignKeys

The non-skipped tables have a foreign-key cycle, so there is no parent-first order. A self-reference counts only when all of its columns are NOT NULL.

Fields

§tables: Vec<String>
§

MissingParentRows

A NOT NULL foreign key in child has no parent row to point at: the seeded parent got zero rows, or the relation count is zero. (A nullable foreign key is set to NULL instead.)

Fields

§child: String
§parent: String
§

UnsafeResetSelection

reset_plan would delete a parent’s rows while a skipped table still references it.

Fields

§parent: String

The table that would be emptied.

§skipped_child: String

The skipped table that references it.

§

ParameterLimitTooLow

A single row needs more bind parameters than the limit (max_params, or the dialect’s maximum).

Fields

§table: String

The table being seeded.

§required: usize

Parameters one row needs.

§limit: usize

The configured limit.

§

UnknownTable

A *_by_name setting names a table the schema does not have.

Fields

§table: String

The name as given.

§known: Vec<String>

The schema’s tables.

§

AmbiguousTable

A *_by_name setting names a table that exists in several namespaces; qualify it as schema.table.

Fields

§table: String

The name as given.

§candidates: Vec<String>

The matching tables.

§

UnknownColumn

A *_by_name setting names a column the table does not have.

Fields

§table: String

The table.

§column: String

The column name as given.

§known: Vec<String>

The table’s columns.

§

NotRelated

relation_by_name was given a child with no foreign key to parent.

Fields

§parent: String

The parent table.

§child: String

The child table.

§

DialectNotEnabled

Schema::from_snapshot was given a snapshot for a dialect whose feature (sqlite, postgres or mysql) is off.

Fields

§dialect: String

The snapshot’s dialect.

§

NoLiteral

A value has no SQL literal form, so the statement cannot be written with its values inline (inline_sql, try_generate_script).

Fields

§reason: String

What is wrong with the value.

§

InvalidValue

A generated value cannot be stored in the column’s SQL type.

Fields

§table: String

The table being seeded.

§column: String

The column.

§reason: String

What is wrong with the value.

Trait Implementations§

Source§

impl Clone for SeedError

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SeedError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for SeedError

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for SeedError

Source§

impl Error for SeedError

1.30.0 · Source§

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

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl PartialEq for SeedError

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SeedError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<Joined, From> JoinKey<From, JoinReverse> for Joined
where From: Joinable<Joined> + ?Sized,

Source§

fn pairs() -> &'static [(&'static str, &'static str)]

(joined_column, from_column) pairs the ON condition matches, in key order, read through Self::pair.
Source§

fn pair(pair: &(&'static str, &'static str)) -> (&'static str, &'static str)

The (joined_column, from_column) names of pair.
Source§

impl<List> ListIncludes<Nil, ()> for List

Source§

impl<Mk> MarkerAggValidFor<()> for Mk

Source§

impl<T> ToCompactString for T
where T: Display,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> TypeEq<T> for T

Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V