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

Is it just me who thinks that plain SQL has won the SQL vs ORM battle? I mean why should I learn how to use X different ORM syntaxes in Y different languages and in addition to that lose full control over the actual query.


Use whatever works for you! I personally felt the same until I learned of Prisma. The main benefits for me are type checking and autocomplete.

Autocomplete is the big one as it lessens the learning curve immensely. You no longer have to search through documentation to find a relevant method, you simply have to trigger autocomplete and it'll show you what you can do!


Big fan of queries being written in SQL and yielding pure, properly structured business objects.

An example of this approach is PureORM[0]

[0]https://github.com/craigmichaelmartin/pure-orm


That's how I've personally felt since I first encountered ORMs a decade ago at a data intensive startup where ORMs were a burden. Yet I keep running into ORMs.

Luckily, they are better implemented at my current job. I still think it gets in the way quite often, but I recognize that it enables some outsized returns on effort. Entire REST APIs can be generated with things like Spring Data. SqlAlchemy can be pretty slick in Python.

I still write raw SQL on my personal projects, but I recognize that I have to spend a lot of time doing that.




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

Search: