pub struct TypeRegistrationOptions {
pub on_existing: OnExisting,
pub revalidate: bool,
pub dry_run: bool,
pub migrations: Vec<MigrationSpec>,
}Expand description
Per-batch registration options.
Fields§
§on_existing: OnExisting§revalidate: boolAdmit a change the schemas cannot prove compatible when every stored row of the type still validates against the candidate.
This is deliberately a second, explicit ground for admission rather
than a relaxation of the first: it is a statement about this tenant’s
current rows, not about the accepted instance sets, and it costs a
scan of the type bounded by type_update_max_rows.
dry_run: boolCompute and report every verdict, write nothing.
migrations: Vec<MigrationSpec>Payload migrations, at most one per type in the batch.
A migration is the third ground for admitting a change, and the only one that changes data: the steps are applied to every live row of the type, the result is validated against the candidate, and nothing is written unless every row passes. It requires a schema change to migrate towards — a migration on an unchanged type would be a data-editing API wearing a type endpoint’s clothes.
Implementations§
Source§impl TypeRegistrationOptions
impl TypeRegistrationOptions
Sourcepub fn migration_for(&self, type_id: &str) -> Option<&MigrationSpec>
pub fn migration_for(&self, type_id: &str) -> Option<&MigrationSpec>
The migration declared for type_id, if any.