Validators¶
Validators implement focused, composable validation rules that compare ORM models against specifications.
Each validator: - operates on a single model - produces structured validation issues - is independent of execution order
Validator Protocol¶
ColumnNullabilityValidator¶
Ensures required columns are not nullable.
ColumnPresenceValidator¶
Ensures all specified columns exist on the ORM model.
PrimaryKeyValidator¶
Validates primary key presence, nullability, and alignment with specs.
Validates primary key presence and correctness.
Always-on: - PK must exist - PK columns must be NOT NULL
Spec-aware (if FieldSpec provided): - Spec PKs must exist in ORM - ORM PKs should be declared in spec
ForeignKeyShapeValidator¶
Validates structural correctness of foreign key definitions.