rusty_schema_diff/lib.rs
1//! Rusty Schema Diff - A library for analyzing and managing schema evolution
2//!
3//! This library provides tools to analyze and manage schema changes across different versions
4//! of data structures, APIs, and database schemas. It supports multiple schema formats including
5//! JSON Schema, Protobuf, OpenAPI, and SQL DDL.
6//!
7//! # Features
8//! - Schema compatibility analysis
9//! - Migration path generation
10//! - Breaking change detection
11//! - Multi-format support
12//!
13//! # Example
14//! ```rust
15//! use rusty_schema_diff::{Schema, SchemaFormat, JsonSchemaAnalyzer, SchemaAnalyzer};
16//!
17//! let old_schema = Schema::new(
18//! SchemaFormat::JsonSchema,
19//! r#"{"type": "object"}"#.to_string(),
20//! "1.0.0".parse().unwrap()
21//! );
22//!
23//! let new_schema = Schema::new(
24//! SchemaFormat::JsonSchema,
25//! r#"{"type": "object", "required": ["id"]}"#.to_string(),
26//! "1.1.0".parse().unwrap()
27//! );
28//!
29//! let analyzer = JsonSchemaAnalyzer;
30//! let report = analyzer.analyze_compatibility(&old_schema, &new_schema).unwrap();
31//! println!("Compatible: {}", report.is_compatible);
32//! ```
33mod analyzer;
34mod schema;
35mod migration;
36mod report;
37mod error;
38
39pub use analyzer::{
40 SchemaAnalyzer,
41 json_schema::JsonSchemaAnalyzer,
42 protobuf::ProtobufAnalyzer,
43 openapi::OpenApiAnalyzer,
44 sql::SqlAnalyzer,
45};
46pub use schema::{Schema, SchemaFormat};
47pub use migration::MigrationPlan;
48pub use report::{CompatibilityReport, ValidationResult};
49pub use error::SchemaDiffError;
50
51/// Re-exports of commonly used types
52pub mod prelude {
53 pub use crate::{
54 SchemaAnalyzer,
55 Schema,
56 SchemaFormat,
57 MigrationPlan,
58 CompatibilityReport,
59 ValidationResult,
60 SchemaDiffError,
61 JsonSchemaAnalyzer,
62 ProtobufAnalyzer,
63 OpenApiAnalyzer,
64 SqlAnalyzer,
65 };
66}