rusty_schema_diff/
lib.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//! 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
//! ```rust
//! 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);
//! ```
mod analyzer;
mod schema;
mod migration;
mod report;
mod error;

pub use analyzer::{
    SchemaAnalyzer,
    json_schema::JsonSchemaAnalyzer,
    protobuf::ProtobufAnalyzer,
    openapi::OpenApiAnalyzer,
    sql::SqlAnalyzer,
};
pub use schema::{Schema, SchemaFormat};
pub use migration::MigrationPlan;
pub use report::{CompatibilityReport, ValidationResult};
pub use error::SchemaDiffError;

/// Re-exports of commonly used types
pub mod prelude {
    pub use crate::{
        SchemaAnalyzer,
        Schema,
        SchemaFormat,
        MigrationPlan,
        CompatibilityReport,
        ValidationResult,
        SchemaDiffError,
        JsonSchemaAnalyzer,
        ProtobufAnalyzer,
        OpenApiAnalyzer,
        SqlAnalyzer,
    };
}