Why is Prisma the exception to ORM hate?

I've never used an ORM, but for years have heard mostly negative things across various languages. People throwing terms like anti-pattern etc. Yet Prisma touts itself as the "Next-generation Node.js and TypeScript ORM" and people suddenly seem to be more lenient with the idea. Random example: https://twitter.com/matteocollina/status/1384900740754386946?lang=en Why is this? What key criticism did it address to gain such popularity?
Matteo Collina (@matteocollina)
Prisma is the most interesting thing in database access happening in the Node.js space. I’m usually against ORMs but I recommend you to check this out and evaluate. https://t.co/VTVjIjDsdi
Likes
350
Twitter
8 Replies
theo (t3.gg)
theo (t3.gg)•2y ago
Great question actually The tl;dr is the separation of parts. It is a schema, client and query builder. The schema is a much clearer abstraction than the more abstracted models most ORMs make you commit to The typescript "comes from the schema" whereas other orms have a schema generated from the code
Sean Cassiere
Sean Cassiere•2y ago
Sachin Raja (@s4chinraja)
@jsumners79 @matteocollina Key word here is care. They aren't saying you shouldn't know it, they're saying you shouldn't have to work with it so much.
Twitter
Halu
Halu•2y ago
Very interesting, so my take away is: db swapping aside ORMs have mostly been a QOL/DX argument afaik It sounds like Typescript gave it more W's to add to the list then. But TS isn't the only language with types and ORMs get hate else where too. So I suppose the fact that web tech has a relatively common goal, as opposed to systems programming where the goal is a bit more nebulous, enables this fullstack solution (schema, client, builder). A fullstack solution to a problem is not merely DX imo, but now offers architectural consistency and constancy where other fields find pain points
theo (t3.gg)
theo (t3.gg)•2y ago
The schema can compile to rust as well And golang The schema is not in a specific language That's the difference
Christoph
Christoph•2y ago
I love Prisma because I hate migration files.
Brendonovich
Brendonovich•2y ago
it sure can 😉 Also don't forget python
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Nic
Nic•2y ago
My 2c coming form a former laravel dev. I for some reason decided to create the database first, then the ORM/schema after. It was just easier that way. That resulted in never using foreign keys, and indexes were a mess. Using prisma, generating the schema first helped me a ton by forcing me to think of the data structure first instead of just winging it. It also set up the foreign keys and indexes a lot more efficiently than I could have done. It also allowed me to be more “nomadic” in my dev environment. Like someone above said migration files are a pain to work with. With prisma you define the schema once, db push and you’re up to date. TLDR: prisma is such a pleasure to work with, and it’s crud functions are simple enough and elegant. My hot take: having a library that forms the raw queries for you instead of you making strings and an execute function makes the code 1000% more reusable. ORMs are useful in that regard. Prisma specifically because if you change the schema, you start getting TS errors if say you change a column from “total_billed” to “totalBilled” in the schema. Building query strings wouldn’t necessarily pick up that change.
Want results from more Discord servers?
Add your server