Closed AndryHTC closed 3 months ago
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.
For example prisma.user.findMany({ select: { id: true} })
means the returned data is [{id: 1}, {id: 2}]
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!