(datamodel: DMMF.Datamodel, runtimeName: TSClientOptions['runtimeName'])
| 23 | * @returns |
| 24 | */ |
| 25 | export function buildRuntimeDataModel(datamodel: DMMF.Datamodel, runtimeName: TSClientOptions['runtimeName']) { |
| 26 | const runtimeDataModel = dmmfToRuntimeDataModel(datamodel) |
| 27 | |
| 28 | let prunedDataModel: PrunedRuntimeDataModel | RuntimeDataModel |
| 29 | if (runtimeName === 'wasm-compiler-edge' || runtimeName === 'client') { |
| 30 | prunedDataModel = pruneRuntimeDataModel(runtimeDataModel) |
| 31 | } else { |
| 32 | prunedDataModel = runtimeDataModel |
| 33 | } |
| 34 | const datamodelString = escapeJson(JSON.stringify(prunedDataModel)) |
| 35 | |
| 36 | return ` |
| 37 | config.runtimeDataModel = JSON.parse(${JSON.stringify(datamodelString)}) |
| 38 | defineDmmfProperty(exports.Prisma, config.runtimeDataModel)` |
| 39 | } |
no test coverage detected