#[cfg(feature = "schema")]
fn main() {
use laminate::schema::InferredSchema;
use serde_json::json;
println!("=== Schema Inference ===\n");
let training = vec![
json!({"name": "Alice", "age": 28, "email": "alice@example.com", "active": true}),
json!({"name": "Bob", "age": 35, "email": "bob@example.com", "active": false}),
json!({"name": "Charlie", "age": 42, "email": "charlie@example.com", "active": true}),
json!({"name": "Diana", "age": 31, "email": "diana@example.com", "active": true}),
];
let schema = InferredSchema::from_values(&training);
println!("{}", schema.summary());
println!("\n=== Data Audit ===\n");
let new_data = vec![
json!({"name": "Eve", "age": 25, "email": "eve@example.com", "active": true}),
json!({"name": "Frank", "age": "old", "email": "frank@example.com", "active": true}), json!({"name": "Grace", "age": 29, "active": false}), json!({"name": "Hank", "age": 45, "email": "hank@example.com", "active": "yes", "extra": 1}), ];
let report = schema.audit(&new_data);
println!("{}", report.summary());
}
#[cfg(not(feature = "schema"))]
fn main() {
println!("This example requires the 'schema' feature: cargo run --example schema_inference --features schema");
}