/** * DataBridge DMMF Types — Hybrid Approach (P0-2 Option C) * * These types mirror the subset of Prisma's Data Model Meta Format (DMMF) * that DataBridge actually consumes. By owning our own type definitions we: * * 1. Decouple from Prisma's internal type changes between major versions * 2. Keep a single source of truth for all generators (routes, SDKs, tRPC, gRPC, OpenAPI) * 3. Document exactly which DMMF properties the codebase relies on * * The types are structurally compatible with Prisma's real DMMF output so * `getDMMF()` results can be assigned to `DmmfDocument` without an adapter layer. * * TEACHING NOTE: If Prisma adds new fields to DMMF in a future version, we only * need to update THIS file — all downstream consumers inherit the change. */ /** Root structure returned by Prisma's `getDMMF()`. */ export interface DmmfDocument { datamodel: DmmfDatamodel; } /** Container for all models, enums, and composite types. */ export interface DmmfDatamodel { models: DmmfModel[]; enums: DmmfEnum[]; types: DmmfModel[]; } /** A single Prisma model (maps to one database table). */ export interface DmmfModel { name: string; fields: DmmfField[]; primaryKey?: DmmfPrimaryKey | null; uniqueFields?: string[][]; uniqueIndexes?: DmmfUniqueIndex[]; documentation?: string; } /** * A field inside a DmmfModel. * * Covers scalar columns, relation pointers, and enum references. */ export interface DmmfField { name: string; /** Prisma type name — e.g. "String", "Int", "DateTime", or a model/enum name for relations. */ type: string; kind: DmmfFieldKind | (string & {}); isRequired: boolean; isList: boolean; isUnique?: boolean; isId: boolean; isReadOnly: boolean; isGenerated?: boolean; isUpdatedAt?: boolean; hasDefaultValue: boolean; default?: unknown; documentation?: string; relationName?: string; relationFromFields?: string[]; relationToFields?: string[]; relationOnDelete?: string; } /** Discriminator for field kinds. */ export type DmmfFieldKind = 'scalar' | 'object' | 'enum' | 'unsupported'; export interface DmmfEnum { name: string; values: DmmfEnumValue[]; documentation?: string; } export interface DmmfEnumValue { name: string; documentation?: string; } export interface DmmfPrimaryKey { name: string | null; fields: string[]; } export interface DmmfUniqueIndex { name: string | null; fields: string[]; } //# sourceMappingURL=dmmf.d.ts.map