zyvor validate
Checks your schema without generating anything.
zyvor validate # defaults to rust.schema
zyvor validate .zyvor/schema.zyvor # explicit path
Success:
Schema is valid: .zyvor/schema.zyvor
What it runs
source → lexer → parser → AST → semantic validator
No files written, no database contacted. This is the fastest way to check a schema edit.
What it catches
| Category | Examples |
|---|---|
| Syntax | unterminated string, invalid character, malformed attribute |
| Structure | missing @id, multiple @id, duplicate model or field names |
| References | unknown model in a relation, unknown field in fields / references |
| Relations | @relation on a scalar field, mismatched fields / references counts |
| Keys | referenced column isn’t a PK or @unique |
| Types | FK type doesn’t match the referenced column type |
| M2M | incomplete or contradictory through / pivotFrom / pivotTo metadata |
When to reach for it
- Learning the schema language — tight feedback loop, no side effects.
- In CI, as a cheap gate before generating.
- After a big refactor, before you look at generated output.
Known gaps
Error messages don’t yet carry line/column information, and some edge cases
slip through: relation cardinality/array-shape consistency, default-value
type compatibility, and full @@index / @@unique field validation.
So validate passing means “no known rule violated”, not “provably correct”.
Review your generated diff before applying it.