(datamodel: DMMF.Datamodel, runtimeName: TSClientOptions['runtimeName'])
| 14 | * it into generated client. |
| 15 | */ |
| 16 | export function buildRuntimeDataModel(datamodel: DMMF.Datamodel, runtimeName: TSClientOptions[class="st">'runtimeName']) { |
| 17 | const runtimeDataModel = dmmfToRuntimeDataModel(datamodel) |
| 18 | |
| 19 | let prunedDataModel: PrunedRuntimeDataModel | RuntimeDataModel |
| 20 | if (runtimeName === class="st">'wasm-compiler-edge' || runtimeName === class="st">'client') { |
| 21 | prunedDataModel = pruneRuntimeDataModel(runtimeDataModel) |
| 22 | } else { |
| 23 | prunedDataModel = runtimeDataModel |
| 24 | } |
| 25 | const datamodelString = escapeJson(JSON.stringify(prunedDataModel)) |
| 26 | |
| 27 | return ` |
| 28 | config.runtimeDataModel = JSON.parse(${JSON.stringify(datamodelString)})` |
| 29 | } |
no test coverage detected