Crate rusty_schema_diff

Source
Expand description

Rusty Schema Diff - A library for analyzing and managing schema evolution

This library provides tools to analyze and manage schema changes across different versions of data structures, APIs, and database schemas. It supports multiple schema formats including JSON Schema, Protobuf, OpenAPI, and SQL DDL.

§Features

  • Schema compatibility analysis
  • Migration path generation
  • Breaking change detection
  • Multi-format support

§Example

use rusty_schema_diff::{Schema, SchemaFormat, JsonSchemaAnalyzer, SchemaAnalyzer};
 
let old_schema = Schema::new(
    SchemaFormat::JsonSchema,
    r#"{"type": "object"}"#.to_string(),
    "1.0.0".parse().unwrap()
);
 
let new_schema = Schema::new(
    SchemaFormat::JsonSchema,
    r#"{"type": "object", "required": ["id"]}"#.to_string(),
    "1.1.0".parse().unwrap()
);
 
let analyzer = JsonSchemaAnalyzer;
let report = analyzer.analyze_compatibility(&old_schema, &new_schema).unwrap();
println!("Compatible: {}", report.is_compatible);

Modules§

prelude
Re-exports of commonly used types

Structs§

CompatibilityReport
Represents compatibility analysis results
JsonSchemaAnalyzer
Analyzes JSON Schema changes and generates compatibility reports.
MigrationPlan
Represents a plan for migrating between schema versions
OpenApiAnalyzer
Analyzes OpenAPI changes and generates compatibility reports.
ProtobufAnalyzer
Analyzes Protobuf changes and generates compatibility reports.
Schema
SqlAnalyzer
Analyzes SQL DDL changes and generates compatibility reports.
ValidationResult
Represents validation results for schema changes

Enums§

SchemaDiffError
Represents errors that can occur during schema analysis operations
SchemaFormat

Traits§

SchemaAnalyzer
Core trait for implementing schema analyzers