←back to thread

873 points belter | 2 comments | | HN request time: 0.019s | source
Show context
juhanakristian ◴[] No.42953769[source]
> ORMs are the devil in all languages and all implementations. Just write the damn SQL

What are the main issues people run into with ORMs? I've used Django ORM for years and written some relatively large applications using it without much problems. Complex queries and aggregations can result in quite hairy code though.

replies(2): >>42953867 #>>42958118 #
1. ramon156 ◴[] No.42953867[source]
I can give an example for Prisma.

It joins in code, not in SQL. We realized this way too late because we assumed an ORM is optimally structuring code. It wasn't.

This, along with the fact that SQL is already a definitive language, made us realize that ORM's are stupid and utterly useless. I'm talking about the ones that try to pretend they're code, and not a query.

There are multiple ways you can design an ORM though, and one way is to let the user fully manage how they want the query to run, so you're pretty much structuring a query already. Why not go the extra mile and make an SQL query?

I get that ORM's are fine when you don't want to deal with writing queries (e.g. school projects) but for real world apps just take the extra minute...

replies(1): >>42954357 #
2. gniting ◴[] No.42954357[source]
Perhaps this information will be helpful context for you and for anyone else who happens to land on this post: - https://www.prisma.io/blog/prisma-orm-now-lets-you-choose-th...

- https://www.prisma.io/blog/database-vs-application-demystify...