pub fn validate_schema(schema: Schema) -> Result<SchemaIr>Expand description
Validates a schema AST and produces a validated IR.
This performs multi-pass validation:
- Collect all model and enum names, check for duplicates
- Validate model fields, types, and constraints
- Validate relations and foreign key integrity
- Validate default values and type compatibility
- Build the final IR
All validation errors are collected and returned together when possible.