Skip to main content

validate_schema

Function validate_schema 

Source
pub fn validate_schema(schema: Schema) -> Result<SchemaIr>
Expand description

Validates a schema AST and produces a validated IR.

This performs multi-pass validation:

  1. Collect all model and enum names, check for duplicates
  2. Validate model fields, types, and constraints
  3. Validate relations and foreign key integrity
  4. Validate default values and type compatibility
  5. Build the final IR

All validation errors are collected and returned together when possible.