OzzyRMOzzyRMDocs
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

TypeScript
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

FieldTypeRequiredNotes
idstringyesCatalog version id. Also used as scenarios.schemaId
sourcesstring[]yesOzzyRMSchemaSource.id values to merge
labelstringnoDisplay label
filestringnoSidebar file name. Defaults to id
versionstringnoSemver-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 users can resolve to Prisma User @@map("users") when that identity has a single owner
  • Fail closed: loadCatalog() / generate reject with aggregated diagnostics; watch keeps the previous valid catalog and logs the error

Common diagnostic codes

CodeMeaning
DUP_MODELTwo sources define the same model identity
DUP_TABLE_NAMETwo sources own the same mapped table name
DUP_ENUMTwo sources define the same enum identity
REL_TARGET_NOT_FOUNDRelation points at a missing model or table
REL_FIELD_NOT_FOUNDRelation 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 ConfigErrorOverlay with a copyable message

Next

On this page