Configuration
Unified graph
Merge multiple schema sources into one validated catalog entry.
Use unified to merge selected sources into one validated graph. Member sources leave the standalone sidebar list and appear as a single unified entry. The overview lists exactly what was merged (id + orm).
Example
import { defineProject, prisma, sql } from "ozzyrm";
export default defineProject({
schemas: [
prisma({ id: "app-prisma", include: ["./prisma/schema.prisma"] }),
sql({ id: "legacy-sql", include: ["./db/legacy.sql"] }),
],
unified: [
{
id: "company-schema",
sources: ["app-prisma", "legacy-sql"],
file: "company",
version: "1.0.0",
},
],
});Unified fields
| Field | Type | Required | Notes |
|---|---|---|---|
id | string | yes | Catalog version id. Also used as scenarios.schemaId |
sources | string[] | yes | OzzyRMSchemaSource.id values to merge |
label | string | no | Display label |
file | string | no | Sidebar file name. Defaults to id |
version | string | no | Semver-like label. Default 1.0.0 |
Rules
- Explicit only: sources not listed in any unified group stay standalone
- Strict conflicts: duplicate model, table, or enum identities always fail (no silent merge)
- Cross-source relations: a SQL FK to
userscan resolve to PrismaUser @@map("users")when that identity has a single owner - Fail closed:
loadCatalog()/generatereject with aggregated diagnostics; watch keeps the previous valid catalog and logs the error
Common diagnostic codes
| Code | Meaning |
|---|---|
DUP_MODEL | Two sources define the same model identity |
DUP_TABLE_NAME | Two sources own the same mapped table name |
DUP_ENUM | Two sources define the same enum identity |
REL_TARGET_NOT_FOUND | Relation points at a missing model or table |
REL_FIELD_NOT_FOUND | Relation references a missing field |
If two sources both own the same table identity (for example both map to
users), unified load fails with aggregated DUP_* / REL_* diagnostics.
UI behavior
- Member sources disappear from the source sidebar
- The unified entry shows which sources were merged
- Validation failures can surface in
ConfigErrorOverlaywith a copyable message
Next
- Scenarios to slice a unified (or standalone) schema
- Mount in React