Trait SchemaAnalyzer

Source
pub trait SchemaAnalyzer {
    // Required methods
    fn analyze_compatibility(
        &self,
        old: &Schema,
        new: &Schema,
    ) -> Result<CompatibilityReport, SchemaDiffError>;
    fn generate_migration_path(
        &self,
        old: &Schema,
        new: &Schema,
    ) -> Result<MigrationPlan, SchemaDiffError>;
    fn validate_changes(
        &self,
        changes: &[SchemaChange],
    ) -> Result<ValidationResult, SchemaDiffError>;
}
Expand description

Core trait for implementing schema analyzers

This trait defines the required functionality for analyzing schema changes and generating compatibility reports and migration paths.

Required Methods§

Source

fn analyze_compatibility( &self, old: &Schema, new: &Schema, ) -> Result<CompatibilityReport, SchemaDiffError>

Analyzes compatibility between two schema versions

§Arguments
  • old - The original schema version
  • new - The new schema version to compare against
§Returns

A compatibility report detailing the differences and compatibility status

Source

fn generate_migration_path( &self, old: &Schema, new: &Schema, ) -> Result<MigrationPlan, SchemaDiffError>

Generates a migration path between schema versions

§Arguments
  • old - The source schema version
  • new - The target schema version
§Returns

A migration plan detailing the required changes

Source

fn validate_changes( &self, changes: &[SchemaChange], ) -> Result<ValidationResult, SchemaDiffError>

Validates proposed schema changes

§Arguments
  • changes - List of proposed schema changes to validate
§Returns

Validation results indicating if the changes are safe

Implementors§