You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that in Dart Prisma ORM version 4.x, the generated model classes have nullable attributes (?) for all fields, even when the corresponding fields in the Prisma schema are explicitly marked as non-nullable.
Is this an expected behavior in Prisma ORM 4.x? If so, what is the reasoning behind generating nullable attributes for non-nullable fields?
If this is not the intended behavior, I would appreciate any guidance on how to ensure that the generated Dart models respect the nullability constraints defined in the Prisma schema.
Thank you for your help!
The text was updated successfully, but these errors were encountered:
You should note that 4.0 supports the select and include functions. This means that the returned data fields are completely undefined. You can ask the ORM to return fields that you specify. Then other fields mean null values. So all fields being nullable is deliberate behavior.
I noticed that in Dart Prisma ORM version 4.x, the generated model classes have nullable attributes (
?
) for all fields, even when the corresponding fields in the Prisma schema are explicitly marked as non-nullable.Is this an expected behavior in Prisma ORM 4.x? If so, what is the reasoning behind generating nullable attributes for non-nullable fields?
If this is not the intended behavior, I would appreciate any guidance on how to ensure that the generated Dart models respect the nullability constraints defined in the Prisma schema.
Thank you for your help!
The text was updated successfully, but these errors were encountered: