pub struct SchemaMutations {
pub alter_column_type: bool,
pub alter_column_properties_atomic: bool,
}Expand description
The database’s capabilities to mutate the schema (tables, columns, indices).
Used by the migration generator to decide how to express each
column change. alter_column_type gates whether an in-place
ALTER COLUMN is possible at all — SQLite has it set to false,
and a type change there triggers a full table rebuild (create
new table, copy rows, drop old). alter_column_properties_atomic
decides whether several column-property changes (rename, retype,
NOT NULL, default) collapse into one statement or emit one per
property. MySQL sets both to true; PostgreSQL alters in place
but requires one statement per property.
Pre-built configurations: SQLITE,
POSTGRESQL, MYSQL,
DYNAMODB.
§Examples
Access through Capability::schema_mutations:
use toasty_core::driver::Capability;
let cap = &Capability::POSTGRESQL;
assert!(cap.schema_mutations.alter_column_type);
assert!(!cap.schema_mutations.alter_column_properties_atomic);Fields§
§alter_column_type: boolWhether the database can change the type of an existing column.
alter_column_properties_atomic: boolWhether the database can change name, type and constraints of a column all withing a single statement.
Implementations§
Source§impl SchemaMutations
impl SchemaMutations
Sourcepub const POSTGRESQL: Self
pub const POSTGRESQL: Self
PostgreSQL schema mutation capabilities. Supports altering column types but not atomically changing multiple column properties.