4 ms·
It took me a long time to realise this but I discovered the only thing I really needed from an ORM was a type safe query builder. Essentially a drop in replacem
by cjdell 3y ago
It took me a long time to realise this but I discovered the only thing I really needed from an ORM was a type safe query builder. Essentially a drop in replacement for trivial SQL queries, which is most of them.
This article sums up the difference between old and new quite nicely. Prisma is fantastic for rapid development and type safety but doesn't require you to completely change the way you write code as it is still basically just a query generator, unlike traditional ORMs which use hidden magic to try to do everything for you with surprising consequences.
https://www.prisma.io/docs/concepts/more/comparisons/prisma-and-typeorm https://www.prisma.io/docs/concepts/more/comparisons/prisma-...
- erikpukinskis 3y agoI don’t think you can call Prisma a “query builder”… It introduces its own global DSL for describing relationships between tables, and then you query that. So if you need a relationship for any query, it’s now present in the model for every query. That doesn’t feel like a query builder to me. A query builder should still look like the SQL if you blur your eyes. Prisma does not.
- sorenbs 3y agoA different view on this is that relationships is a property of the data, not of the query. So it makes sense to represent that in a single place instead of repeating it for every query. Now, if multiple teams have differing understandings of what relationships are present in the data, they can go ahead and use separate Prisma Schemas.