Skip to content
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

(Prisma 5) fix: nullable to one relation filter input (BREAKING) #3969

Merged
merged 1 commit into from
Jun 22, 2023

Conversation

Weakky
Copy link
Member

@Weakky Weakky commented May 11, 2023

⚠️ DO NOT MERGE BEFORE PRISMA 5

Overview

DMMF changes

Given the following datamodel:

model User {
  id Int @id

  addressId Int     @unique
  address   Address @relation(fields: [addressId], references: [id])

  post Post[]
}

model Address {
  id Int @id

  user User?
}

model Post {
  id Int @id

  userId Int
  user   User @relation(fields: [userId], references: [id])
}

It changes DMMF in the following ways:

input UserRelationFilter {
  is: UserWhereInput
  isNot: UserWhereInput
}

+input UserNullableRelationFilter {
+  is: UserWhereInput | Null
+  isNot: UserWhereInput | Null
+}

input AddressWhereInput {
  AND: AddressWhereInput | [AddressWhereInput]
  OR: [AddressWhereInput]
  NOT: AddressWhereInput | [AddressWhereInput]
  id: IntFilter | Int
- user: UserRelationFilter | UserWhereInput
+ user: UserNullableRelationFilter | UserWhereInput
}

input AddressWhereUniqueInput {
  id: Int
  AND: AddressWhereInput | [AddressWhereInput]
  OR: [AddressWhereInput]
  NOT: AddressWhereInput | [AddressWhereInput]
-  user: UserRelationFilter | UserWhereInput
+  user: UserNullableRelationFilter | UserWhereInput
}

input PostWhereInput {
  AND: PostWhereInput | [PostWhereInput]
  OR: [PostWhereInput]
  NOT: PostWhereInput | [PostWhereInput]
  id: IntFilter | Int
  userId: IntFilter | Int
  user: UserRelationFilter | UserWhereInput
}

@codspeed-hq
Copy link

codspeed-hq bot commented May 11, 2023

CodSpeed Performance Report

Merging #3969 prisma5/fix-to-one-nullable-input (a638144) will not alter performances.

Summary

🔥 0 improvements
❌ 0 regressions
✅ 11 untouched benchmarks

🆕 0 new benchmarks
⁉️ 0 dropped benchmarks

@Weakky Weakky added this to the 5.0.0 milestone May 11, 2023
@Jolg42
Copy link
Contributor

Jolg42 commented May 31, 2023

Note: someone will need to resolve the merge conflicts

Copy link
Contributor

@Druue Druue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm 🌸

@Weakky Weakky force-pushed the prisma5/fix-to-one-nullable-input branch from 536b833 to a638144 Compare June 22, 2023 14:47
@Weakky Weakky marked this pull request as ready for review June 22, 2023 15:52
@Weakky Weakky requested a review from a team as a code owner June 22, 2023 15:52
@Weakky Weakky merged commit 7709787 into main Jun 22, 2023
29 checks passed
@Weakky Weakky deleted the prisma5/fix-to-one-nullable-input branch June 22, 2023 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

<Model>RelationFilterInput does not take nullability into account
4 participants