dev.to
Why is prisma orm bad?
Excerpt
If you're unfamiliar, Prisma is a well-known TypeScript ORM for PostgreSQL and MongoDB. It was the first ORM I learned to use, and this decision led to some difficulties later on. Prisma's primary issue is that its entity creation and database modeling only work with their own language. ### Why Is This a Problem? ... What's the problem here? At first glance, it might seem trivial, but it actually makes a lot of sense: with Prisma, you're forced to create all your logic using their programming language (or markdown language, I'm not sure what it's called). This specifically prohibits you from using external libraries or JavaScript code to build more reliable logic in your entities. ### Consequences Since you can't use JavaScript in your code, you should expect to waste a lot of time trying to figure out how Prisma's scaffolding language works and how to create schemas using it. There's also one very important detail: you can't use any external library or helper. Imagine a situation where you need to customize the way your primary keys are generated. With TypeORM, you can simply use this approach: … "Wait, are you saying that creating an easier ORM is bad?" No. I am saying that removing the flexibility of writing more raw-like queries to make the ORM easier can cause issues for developers, such as forgetting how to use SQL.
Related Pain Points
Prisma Schema Language learning curve and edge case limitations
5Developers must learn a custom DSL (Prisma Schema Language) that is neither TypeScript nor SQL. Edge cases like composite keys, database-specific column types, and complex defaults force developers to fight the schema language to express things that are straightforward in raw SQL.
Learning Prisma's schema DSL encourages developers to forget SQL fundamentals
4The ease of Prisma's query builder comes at the cost of developers gradually losing familiarity with raw SQL. The trade-off between simplicity and flexibility means developers become dependent on the ORM abstraction and cannot effectively fall back to direct SQL when needed for complex queries or optimization.