Panic when trying to use Uuid native type with insensitive filters
See original GitHub issueBug description
When the following query where id
is @postgres.Uuid
type is executed prisma is throwing the following panic:
const data = await prisma.user.findMany({
where: {
id: {
mode: "insensitive",
contains: "something",
},
},
});
(node:9993) UnhandledPromiseRejectionWarning: Error:
Invalid `prisma.user.findMany()` invocation:
Error occurred during query execution:
ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(Error { kind: Db, cause: Some(DbError { severity: "ERROR", parsed_severity: Some(Error), code: SqlState("42883"), message: "function lower(uuid) does not exist", detail: None, hint: Some("No function matches the given name and argument types. You might need to add explicit type casts."), position: Some(Original(105)), where_: None, schema: None, table: None, column: None, datatype: None, constraint: None, file: Some("parse_func.c"), line: Some(627), routine: Some("ParseFuncOrColumn") }) }) })
at PrismaClientFetcher.request (/home/harshit/code/reproductions/issue-3447-studio/node_modules/@prisma/client/runtime/index.js:78461:15)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at main (/home/harshit/code/reproductions/issue-3447-studio/main.ts:6:16)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:9993) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:9993) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
How to reproduce
See: https://github.com/harshit-test-org/issue-prisma-5311
Expected behavior
Prisma should not ever generate this invalid sql.
Prisma information
See the reproduction posted above
Environment & setup
- OS: Ubuntu 20.04 via WSL
- Database: Postgres 12 (docker)
- Node.js version: 14.15.2
- Prisma version:
@prisma/cli : 2.16.0-dev.23
@prisma/client : 2.16.0-dev.25
Current platform : debian-openssl-1.1.x
Query Engine : query-engine 874f616fce40a665d24867f42e602ce8b5ed2cd7 (at node_modules/@prisma/engines/query-engine-debian-openssl-1.1.x)
Migration Engine : migration-engine-cli 874f616fce40a665d24867f42e602ce8b5ed2cd7 (at node_modules/@prisma/engines/migration-engine-debian-openssl-1.1.x)
Introspection Engine : introspection-core 874f616fce40a665d24867f42e602ce8b5ed2cd7 (at node_modules/@prisma/engines/introspection-engine-debian-openssl-1.1.x)
Format Binary : prisma-fmt 874f616fce40a665d24867f42e602ce8b5ed2cd7 (at node_modules/@prisma/engines/prisma-fmt-debian-openssl-1.1.x)
Studio : 0.343.0
Preview Features : nativeTypes
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
FCPX Crashes, freezes, kernel Panic... All of them - FCP.co
New SSDs are extremely sensitive to cable type and any other cable or hub may cause the drive to revert to USB 2.0...
Read more >Are we observable yet? An introduction to Rust telemetry
Let's try to launch the application again using cargo run (equivalent to RUST_LOG=info cargo run given our defaulting logic).
Read more >Configuration - Dortania
1 Introduction. This document provides information on the format of the OpenCore user configuration file used to set up the correct functioning of...
Read more >What's New in v21.2 | CockroachDB Docs
The error code reported when trying to use a system or virtual column in the ... BYTES , STRING , UUID , or...
Read more >Release note - Xilinx
v4.15.5.1003 Issue 3336: ~ Fix a mistaken attempt to use PTP on NICs for which ... SF-119883-KI / Issue 78131: ~ Address a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
After investigating the issue, the conclusion is that we’re not yet in a position to fix that issue. We’ll get back to it once the Query Engine can deal with native types more granularly.
I also get the same error when filtering a uuid column using “equals” in Prisma Studio. It works using “in” and adding the uuid value in the array. I haven’t tried other types.