Bar*_*dia 5 postgresql orm pg prisma
我有一个查询
select count(id), status, "createdAt"::date from "ProjectLog" where "projectId" = (select id from "Project" where slug = ${id}) and "createdAt" > current_date - interval '${interval} day' group by "createdAt"::date, status;
Run Code Online (Sandbox Code Playgroud)
我还尝试过用户Prisma.sql在引号内传递值,但它不断抛出错误,它期望 1 个参数,但 fount 2。
我的 prisma 没有这个问题,2.20.1
这个问题只发生在版本上3.3.0
Query: select count(id) as count, status, "createdAt"::date from "ProjectLog" where "projectId" = (select id from "Project" where slug = $1) and "createdAt" > current_date - interval '$2 day' and key notnull group by "createdAt"::date, status
Param: ["main","30"]
PrismaClientKnownRequestError:
Invalid `prisma.queryRaw()` invocation:
Your raw query had an incorrect number of parameters. Expected: `1`, actual: `2`.
code: 'P1016',
clientVersion: '3.3.0',
meta: { expected: 1, actual: 2 }
}
Run Code Online (Sandbox Code Playgroud)
有什么建议 ?我不确定这是否是一个错误。
| 归档时间: |
|
| 查看次数: |
4111 次 |
| 最近记录: |