For Rust-free, what's the rationale for adding "Model" suffixes to every generated model export in P
Can anyone from the Prisma team explain the rationale behind renaming every single model export to now include a Model suffix at the end of each type (for example, UserModel, PostModel, etc.)?
I'm curious what motivated this change, and why that same naming convention isn’t applied to the browser types in the generated Prisma Client.
https://www.prisma.io/docs/orm/prisma-schema/overview/generators#4-use-prisma-client-in-your-application
Generators (Reference) | Prisma Documentation
Generators in your Prisma schema specify what assets are generated when the
prisma generate command is invoked. This page explains how to configure generators.
5 Replies
Ahoy, knowledge seeker! I'm the Prisma AI Help Bot. Do you want a dev's response that might take a hot second, or an AI answer that's ready before your next coffee sip? Either way, your question is important to us.
also why do absolutely all type inferences break in the new prisma version? how is this possible? why has it become so garbage?
just look at all these errors in one file alone

Without knowing why, I'd guess that the Model suffix is added because it more accurately reflects what it is.
You don't have to use them though, or at least I haven't seen the need to convert.
As for the type inference, what exactly is breaking for you? We recently updated to follow the new guidelines for generated output folder, and despite a few complications with getting the conversion across the finish line it has been very smooth.
We've not had to change almost any imports, rename anything. The only thing that is a bit cumbersome is the lack of integration with
prisma-json-types-generator.
Could these errors be happening because your import at the top has broken, and so all the types on the Prisma or PrismaClient import, are broken?Reasoning behind this change:
https://github.com/prisma/prisma/issues/27531#issuecomment-3023459815
GitHub
ESM Model Name suffix · Issue #27531 · prisma/prisma
Bug description Hi there, This PR changed the ESM model exports to have a Model suffix: https://github.com/prisma/prisma/pull/26727/files#diff-264ddc34afc7c904dfe0af24b2b265ed27299067e62c224a007c55...