Hacker News new | ask | show | jobs
by hparadiz 12 days ago
Some of us have been working with php for 22 years at this point and frankly I think Doctrine is the best ORM period.
1 comments

What makes it so good? Genuinely curious
It uses a DTO style mapping system and central factory EntityManager making unit testing a breeze. Model definitions let you map database primitives directly from the models. It will automagically build you the table on first use and it's capable of moving data from one engine to another engine on the fly. Migrations are built in and it's capable of generating migrations directly from changes to a model. It's smart about SQL multi saves (transactions), joins for relationships, views, and a bunch of other database features that most ORMs don't even bother to be even aware of let alone implement. It's basically an enterprise level ORM. Functionally it works like ActiveRecord but under the hood it's very different.
Have you used Django's ORM?
The first time I heard the name Django was like 15 years ago in college so I'm sure I've used it by hosting some project for one reason or another over the years. Python is just not my go to. Also I maintain my own framework in PHP entirely so that's what I pull off the shelf when I wanna do CRUD.
Sure thing, was just curious since you mentioned rails. Django's ORM is pretty similar (auto generated migrations, super easy relations, etc).