Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Every single time. Where are these developers? Orms are a god send 98% of the time. Sure, write some SQL from time to time, but the majority of the time just use the ORM.




We have a POS system where entire blogic is postgres functions.

There are many others as well. Sure Rails/Laravel/Django people use the ORM supplied by their framework, but many of us feel it's un-necessary and limiting.

Limiting because for example many of them don't support cte queries(rails only added it a couple of years ago). Plus it get weird when sometimes you have to use sql.raw because your ORM can't express what you want.

Also transactions are way faster when done in a SQL function than in code. I have also seen people do silly things like call startTransaction in code and the do a network request resulting in table lock for the duration of that call.

Some people complain that writing postgres functions make testing harder, but with pglite it's a non issue.

As an aside I have seen people in finance/healthcare rely on authorization provided by their db, and just give access to only particular tables/functions to a sql role owned by a specific team.


> Orms are a god send 98% of the time.

People who write percentages make shit up 98% of the time.

Or in other words: Source?


> Sure, write some SQL from time to time, but the majority of the time just use the ORM

So add another layer that has to be maintained/debugged when you don't have to?


> Orms are a god send 98% of the time.

Writing queries is trivial and in any marginally complex case I'll write something which beats the ORM for efficiency. I suppose they are a god send if you don't know SQL but you can learn SQL quite quickly.


I worked at a company where we used Dapper with plain SQL. Like the sibling commenter said, simplicity. There were never [ORM] issues to debug and queries could easily be inspected.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: