MCPcopy
hub / github.com/prisma/prisma / field

Function field

packages/client/src/testUtils/dataModelBuilder.ts:4–17  ·  view source on GitHub ↗
(kind: DMMF.FieldKind, name: string, type: string, extra?: Partial<DMMF.Field>)

Source from the content-addressed store, hash-verified

2import type * as DMMF from '@prisma/dmmf'
3
4export function field(kind: DMMF.FieldKind, name: string, type: string, extra?: Partial<DMMF.Field>): DMMF.Field {
5 return {
6 kind,
7 name,
8 type,
9 isRequired: false,
10 isList: false,
11 isUnique: true,
12 isId: true,
13 isReadOnly: false,
14 hasDefaultValue: false,
15 ...extra,
16 }
17}
18
19export function model(name: string, fields: DMMF.Field[]): DMMF.Model {
20 return {

Calls

no outgoing calls

Tested by

no test coverage detected