News for hackers. Stuff that matters.
Re:Django: One ORM to rule all databases by anticodon on Sunday October 12, 2025 @09:19AM (#45558051)
But why? Although I have way more experience with Django ORM, I find that SQLAlchemy is closer to SQL and I have to think less how to express complex queries. With Django ORM changing a few characters can change resulting query from LEFT JOIN to INNER JOIN, for example. I find it more difficult to write complex queries in Django ORM.
Re:Django: One ORM to rule all databases by izacus on Sunday October 12, 2025 @10:28AM (#45558467)
Being closer to SQL in my projects meant that it had more footguns than C++ and developers had to know a lot about DB details to not break things.
Re:Django: One ORM to rule all databases by bbkane on Sunday October 12, 2025 @10:30AM (#45558482)
I don't think it's unreasonable that devs should have to learn about database details to correctly use a database.

Could you list some specific examples where things broke because of SQLAlchemy's design?

Re:Django: One ORM to rule all databases by izacus on Sunday October 12, 2025 @01:49PM (#45560198)
Managing connections, connection looking and transactions was something that was always an issue with SQLalchemy for us. Migrations were significantly more terrible as well.
Re:Django: One ORM to rule all databases by lelanthran on Sunday October 12, 2025 @10:36AM (#45558529)
The only footgun is pretending that using an ORM means not having to learn SQL.
Re:Django: One ORM to rule all databases by codr7 on Sunday October 12, 2025 @11:06AM (#45558720)
Exactly!

I like my ORMs based on SQL concepts, not OOP concepts.

So you do have to know SQL, but you get more convenient ways of generating it.

https://github.com/codr7/tyred

Re:Django: One ORM to rule all databases by izacus on Sunday October 12, 2025 @01:48PM (#45560185)
That's not what I said though.
Re:Django: One ORM to rule all databases by sgarland on Sunday October 12, 2025 @10:42AM (#45558563)
Wait until you find out that the RDBMS optimizer may also sometimes convert your outer joins to inner joins.

I dislike all ORMs, but I especially dislike SQLAlchemy for its hideously bad docs.