-
-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support extendedWhereUnique preview feature #59
Comments
This happens with tRPC v10, correct? |
No, I am using |
Could you share a sample schema that produce this issue? |
I think this issue could be related to previewFeature "prisma-zod-generator": "^0.8.6" I will try and check if disabling it solves the issue. Update: Just tested this, It still shows error |
I would appreciate it if you could share a schema that I could test on, so I could provide a fix for it |
@mubaidr Still waiting for more details. What are you trying to accomplish with this library? What exactly is invalid to you? Please clarify what exactly is the problem and sample code is possible. |
Sorry for the delayed response.
generator client {
provider = "prisma-client-js"
previewFeatures = ["extendedWhereUnique", "filteredRelationCount", "orderByNulls"]
}
generator zod {
provider = "prisma-zod-generator"
output = "./generated/zod"
isGenerateSelect = false
isGenerateInclude = false
}
// generator trpc {
// provider = "prisma-trpc-generator"
// output = "./generated/trpc"
// contextPath = "../context"
// withMiddleware = false
// withShield = false
// isGenerateSelect = false
// isGenerateInclude = false
// }
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
relationMode = "foreignKeys"
}
model City {
id Int @id @default(autoincrement())
title String @unique
createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz
updatedAt DateTime @default(now()) @map("updated_at") @db.Timestamptz
venues Venue[]
@@map("city")
}
model Venue {
id Int @id @default(autoincrement())
code String @unique
title String @unique
address String
capacity Int
available Boolean @default(true)
cityId Int @map("city_id")
createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz
updatedAt DateTime @default(now()) @map("updated_at") @db.Timestamptz
city City @relation(fields: [cityId], references: [id])
@@map("venue")
} After running
|
Thank you for the details. I just confirmed the existence of the bug, will work on it as soon as possible. |
WhereUniqueInputObjectSchema
I did test it by disabling this preview feature here: #59 (comment) But maybe I have missed something. P. S. Thanks for your awesome work. |
Should be fixed in https://github.com/omar-dulaimi/prisma-zod-generator/releases/tag/0.8.10 Please confirm so I could update the tRPC generator as well |
Sure, I will try and report here. 👍🏼 |
Yes, Its working good now! Thanks |
Bug description
Generated schema for
ModelVacancyWhereUniqueInputObjectSchema
is invalid.How to reproduce
prisma
and generator versionprisma generate
ModelVacancyWhereUniqueInputObjectSchema
file for any modelExpected behavior
Generated schema should not contain any errors.
Prisma information
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: