You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Prisma原生查询执行失败求助(版本4.8.1)

Prisma $queryRaw调用报错(Code: N/A, Message: N/A)

我此前联系客服咨询但未得到回复。当前使用Prisma及客户端版本为4.8.1,在执行原生SQL查询时遭遇错误,错误码和消息均显示为N/A,无法识别失败原因,希望得到帮助。

当前使用的核心代码

const response = await this.prisma
      .$queryRaw<Gym>`SELECT * FROM \`Gym\` WHERE \`status\` != 'WITHDRAWAL' LIMIT 1 OFFSET 0;`;

尝试过的其他写法

  • prisma.$queryRawquery``
  • prisma.$queryRaw<Model>query``
  • prisma.$queryRaw<Model[]>query``
  • prisma.$queryRaw(Prisma.sqlquery)
  • prisma.$queryRaw<Model>(Prisma.sqlquery)

完整报错信息

SELECT * FROM `Gym` WHERE `status` != 'WITHDRAWAL' LIMIT 1 OFFSET 0; []
prisma:error 
Invalid `prisma.$queryRaw()` invocation:


Raw query failed. Code: `N/A`. Message: `N/A`
[Nest] 17720  - 2023. 01. 12. 오후 6:09:37   ERROR [ExceptionsHandler] 
Invalid `prisma.$queryRaw()` invocation:


Raw query failed. Code: `N/A`. Message: `N/A`
Error:
Invalid `prisma.$queryRaw()` invocation:


Raw query failed. Code: `N/A`. Message: `N/A`
    at RequestHandler.handleRequestError (D:\practice_ljy\trainning-api\node_modules\@prisma\client\runtime\index.js:35024:13)
    at RequestHandler.handleAndLogRequestError (D:\practice_ljy\trainning-api\node_modules\@prisma\client\runtime\index.js:34996:12)
    at RequestHandler.request (D:\practice_ljy\trainning-api\node_modules\@prisma\client\runtime\index.js:34991:12)
    at Proxy._request (D:\practice_ljy\trainning-api\node_modules\@prisma\client\runtime\index.js:36082:16)

内容的提问来源于stack exchange,提问作者tuliplee

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.04 19:25:20