Commit 2a3738f
feat: add database-level error collection to relationship validation
Completed hierarchical error context by implementing database-level error collection that aggregates schema errors as an array.
Changes:
- Modified ValidateDatabaseSchemas to use MapRecordCollectErrors instead of ExtractTypeValidationErrors
- Database-level validation now collects errors from all schemas as an array
- Removed unused ExtractTypeValidationErrors import
- Added comprehensive tests in validateDatabaseSchemas.type.spec.ts covering:
* Success case when all schemas are valid
* Single invalid schema with full context chain (schema → table → relationship)
* Multiple invalid schemas with errors collected as separate array items
* Empty database success case
The complete error hierarchy is now:
- Database level: Array of schema errors
- Schema level: { schema, errors: [...table errors] }
- Table level: { table, errors: [...relationship errors] }
- Relationship level: { relationship, errors: [...validation errors] }
All validation errors maintain proper TypeValidationResult structure throughout the chain, enabling precise error reporting with full context at every level.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 673f0f2 commit 2a3738f
File tree
4 files changed
+243
-1977
lines changed- src/packages/dumbo/src/core/schema/components/relationships
4 files changed
+243
-1977
lines changedLines changed: 14 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| |||
479 | 478 | | |
480 | 479 | | |
481 | 480 | | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | | - | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
492 | 495 | | |
493 | 496 | | |
494 | 497 | | |
| |||
0 commit comments