MCPcopy
hub / github.com/prisma/prisma / pruneRuntimeDataModel

Function pruneRuntimeDataModel

packages/client-common/src/runtimeDataModel.ts:36–48  ·  view source on GitHub ↗
({ models }: RuntimeDataModel)

Source from the content-addressed store, hash-verified

34 * @returns
35 */
36export function pruneRuntimeDataModel({ models }: RuntimeDataModel) {
37 const prunedModels: PrunedRuntimeDataModel['models'] = {}
38
39 for (const modelName of Object.keys(models)) {
40 prunedModels[modelName] = { fields: [], dbName: models[modelName].dbName }
41
42 for (const { name, kind, type, relationName, dbName } of models[modelName].fields) {
43 prunedModels[modelName].fields.push({ name, kind, type, relationName, dbName })
44 }
45 }
46
47 return { models: prunedModels, enums: {}, types: {} }
48}
49
50function buildMapForRuntime<T extends { name: string }>(list: readonly T[]): Record<string, Omit<T, 'name'>> {
51 const result: Record<string, Omit<T, 'name'>> = {}

Callers 2

buildRuntimeDataModelFunction · 0.90
buildRuntimeDataModelFunction · 0.90

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected