MCPcopy
hub / github.com/prisma/prisma / model

Function model

packages/client/src/testUtils/dataModelBuilder.ts:19–38  ·  view source on GitHub ↗
(name: string, fields: DMMF.Field[])

Source from the content-addressed store, hash-verified

17}
18
19export function model(name: string, fields: DMMF.Field[]): DMMF.Model {
20 return {
21 name,
22 dbName: null,
23 schema: null,
24 fields: [
25 field('scalar', 'id', 'String', {
26 isUnique: true,
27 isId: true,
28 }),
29 ...fields,
30 ],
31 uniqueFields: [],
32 uniqueIndexes: [],
33 primaryKey: {
34 name: 'id',
35 fields: ['id'],
36 },
37 }
38}
39
40export function runtimeDataModel({ models }: { models: DMMF.Model[] }): RuntimeDataModel {
41 return dmmfToRuntimeDataModel({

Calls 1

fieldFunction · 0.70

Tested by

no test coverage detected