MCPcopy
hub / github.com/prisma/prisma / _executeRequest

Method _executeRequest

packages/client/src/runtime/getPrismaClient.ts:996–1067  ·  view source on GitHub ↗
({
      args,
      clientMethod,
      dataPath,
      callsite,
      action,
      model,
      argsMapper,
      transaction,
      unpacker,
      otelParentCtx,
      customDataProxyFetch,
    }: InternalRequestParams)

Source from the content-addressed store, hash-verified

994 }
995
996 async _executeRequest({
997 args,
998 clientMethod,
999 dataPath,
1000 callsite,
1001 action,
1002 model,
1003 argsMapper,
1004 transaction,
1005 unpacker,
1006 otelParentCtx,
1007 customDataProxyFetch,
1008 }: InternalRequestParams) {
1009 try {
1010 // execute argument transformation before execution
1011 args = argsMapper ? argsMapper(args) : args
1012
1013 const spanOptions: ExtendedSpanOptions = {
1014 name: 'serialize',
1015 }
1016
1017 const message = this._tracingHelper.runInChildSpan(spanOptions, () =>
1018 serializeJsonQuery({
1019 modelName: model,
1020 runtimeDataModel: this._runtimeDataModel,
1021 action,
1022 args,
1023 clientMethod,
1024 callsite,
1025 extensions: this._extensions,
1026 errorFormat: this._errorFormat,
1027 clientVersion: this._clientVersion,
1028 previewFeatures: this._previewFeatures,
1029 globalOmit: this._globalOmit,
1030 }),
1031 )
1032
1033 // as prettyPrintArguments takes a bit of compute
1034 // we only want to do it, if debug is enabled for 'prisma-client'
1035 if (Debug.enabled('prisma:client')) {
1036 debug(`Prisma Client call:`)
1037 debug(`prisma.${clientMethod}(${prettyPrintArguments(args)})`)
1038 debug(`Generated request:`)
1039 debug(JSON.stringify(message, null, 2) + '\n')
1040 }
1041
1042 if (transaction?.kind === 'batch') {
1043 /** @see {@link getLockCountPromise} */
1044 await transaction.lock
1045 }
1046
1047 return this._requestHandler.request({
1048 protocolQuery: message,
1049 modelName: model,
1050 action,
1051 clientMethod,
1052 dataPath,
1053 callsite,

Callers 2

applyQueryExtensionsFunction · 0.80

Calls 6

serializeJsonQueryFunction · 0.90
prettyPrintArgumentsFunction · 0.90
debugFunction · 0.85
runInChildSpanMethod · 0.65
requestMethod · 0.65
getActiveContextMethod · 0.65

Tested by

no test coverage detected