Repository navigation
$queryRaw/$queryRawUnsafe is modifying query string and causing DB error #19637
Replies: 2 comments 2 replies
|
Hi @cjscheller 👋 Thanks for raising this question. We would like to reproduce this issue so it would be helpful if you can share the relevant parts of your Prisma schema. I have also shared this issue internally with our engineering team and will get back to you if I receive any information from them. |
|
Hi there, To keep our discussions organized and focused on the most relevant topics, we’re reviewing and tidying up our backlog. As part of this process, we’re closing discussions that haven’t had any recent activity and appear to be outdated. If this discussion is still important to you or unresolved, we’d love to hear from you! Feel free to reopen it or start a new one with updated details. For more details about our priorities and vision for the future of Prisma ORM, check out our latest blog post: https://www.prisma.io/blog/prisma-orm-manifesto. Thank you for your understanding and being part of the community! |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I am trying to execute the following query as a raw database query due to some limitations of the Prisma client related to groupBy. The database is a Planetscale/Vitess MySQL v8 instance.
Whenever I execute this query through a
$queryor$queryRaw, I am receiving the following error (with added formatting):I have attempted:
ONLY_FULL_GROUP_BYin MySQL$queryRawwith templated variables$queryRawUnsafewith a plain string (no variables)$queryRawUnsafewith a parameterized query.No matter what I do, I can not figure out how/where/why the WHERE clause of the query is updated from
WHERE Invoice.id = ${invoiceId}towhere 1 != 1. The query works when I run it manually in a MySQL client (with a WHERE clause such asWHERE Invoice.id = 5, and the MySQL 1055 error is only thrown when the where clause is set as1 != 1.Can anyone help me figure out what is going on? Thanks!
All reactions