Skip to main content

Module schema

Module schema 

Source
Expand description

Database schema introspection and diffing utilities.

Structs§

ColumnDiff
Represents a change in a column (addition or removal).
ColumnNullabilityDiff
Represents a mismatch in column nullability.
ColumnPrimaryKeyDiff
Represents a mismatch in Primary Key status.
ColumnTypeDiff
Represents a mismatch in column types between models and database.
SchemaColumn
Metadata about a database column.
SchemaDiff
Represents the differences between two database schemas.
SchemaForeignKey
Metadata about a foreign key relationship.
SchemaIndex
Metadata about a database index.
SchemaTable
Metadata about a database table.

Traits§

ModelSchema
A trait for models that can provide their own schema metadata.

Functions§

diff_schema
Calculates the difference between two sets of table metadata.
diff_sqlite_schemasqlite
Compares the actual SQLite schema with an expected list of tables.
format_schema_diff_summary
Formats a SchemaDiff into a human-readable summary.
introspect_sqlite_schemasqlite
Introspects the schema of a SQLite database.
sqlite_migration_sql
Generates SQLite migration SQL based on the provided schema differences.