Repository navigation
Closed as not planned
Labels
bug/1-unconfirmedBug should have enough information for reproduction, but confirmation has not happened yet.kind/bugA reported bug.
Description
Describe the bug
I freshley installed prisma and modeled a database structure. Everything was working fine, but I noticed a bug in prisma studio, when I want to open relations by clicking the Open in new tab link.
Error message
Message: Error in Prisma Client request:
Invalid `prisma.coursesOnUsers.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: "operator does not exist: uuid ~~* unknown", detail: None, hint: Some("No operator matches the given name and argument types. You might need to add explicit type casts."), position: Some(Original(358)), where_: None, schema: None, table: None, column: None, datatype: None, constraint: None, file: Some("parse_oper.c"), line: Some(731), routine: Some("op_error") }) }) })
Query:
prisma.coursesOnUsers.findMany({
where: {
AND: [
{
user: {
id: {
equals: "3370259b-3c9e-448e-b74a-0ef48560cfe9",
mode: "insensitive",
},
},
},
]
},
take: 100,
skip: 0,
select: {
user: true,
userId: true,
course: true,
courseId: true,
}
})
Seems to be related with the way the query is generated: activerecord-hackery/ransack#709 (comment)
A video showing what I mean
video_06.mp4
To Reproduce
prisma.schema
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
}
enum Role {
STUDENT
ASSISTANT
TEACHER
}
enum Visibility {
PUBLIC
PRIVATE
}
enum Difficulty {
EASY
MEDIUM
HEAVY
}
model User {
id String @id @default(uuid()) @db.Uuid
email String @db.VarChar
password String @db.VarChar
role Role @default(STUDENT)
courses CoursesOnUsers[]
}
model CoursesOnUsers {
user User @relation(fields: [userId], references: [id])
userId String @db.Uuid
course Course @relation(fields: [courseId], references: [id])
courseId String @db.Uuid
@@id([userId, courseId])
}
model Course {
id String @id @default(uuid()) @db.Uuid
name String @db.VarChar
visibility Visibility @default(PRIVATE)
users CoursesOnUsers[]
topics TopicsOnCourses[]
}
model TopicsOnCourses {
topic Topic @relation(fields: [topicId], references: [id])
topicId String @db.Uuid
course Course @relation(fields: [courseId], references: [id])
courseId String @db.Uuid
@@id([topicId, courseId])
}
model Topic {
id String @id @default(uuid()) @db.Uuid
name String @db.VarChar
visibility Visibility @default(PRIVATE)
courses TopicsOnCourses[]
tasks TasksOnTopics[]
}
model TasksOnTopics {
task Task @relation(fields: [taskId], references: [id])
taskId String @db.Uuid
topic Topic @relation(fields: [topicId], references: [id])
topicId String @db.Uuid
@@id([taskId, topicId])
}
model Task {
id String @id @default(uuid()) @db.Uuid
name String @db.VarChar
difficulty Difficulty @default(MEDIUM)
visibility Visibility @default(PRIVATE)
topics TasksOnTopics[]
}
Steps to reproduce the behavior:
- Migrate the
prisma.schema - Go to
Prisma Studio - Add some data and relations
- Click on the related content
- Click on
Open in new tab - See error
Expected behavior
Successfully open the new tab and display the data.
Screenshots
See the screen recording.
Desktop (please complete the following information):
- OS: WSL2 on Windows 10
- Browser: chrome
- Version: Version 91.0.4472.124 (Offizieller Build) (64-Bit)
Metadata
Metadata
Assignees
Labels
bug/1-unconfirmedBug should have enough information for reproduction, but confirmation has not happened yet.kind/bugA reported bug.
Activity