I’m searching for an easy to use and simple ORM, matching the slimness patterns of Slim to create repositories, mappers and models of my tables from - or maybe generate them from an already existing DB schema as a plus. But without any annotations, non-PHP config files, DB migration support or even a DB modelling engine. Unfortunately most ORM are just overwhelming because they want to solve most or all DB-related narratives.
Their response can be summarized as “use Doctrine (or maybe another Doctrine alternative)”
What do you guys use when you want to handle 4-10 tables with some relations and still keep it simple without a large overhead? To be honest, I’ve already created my own simple ORM, but for a better security feeling I wish I could migrate to a maintained public accessible alternative. Or I’m the only dude afraid to make the last step into Doctrine?
Doctrine is also what comes to my mind when you ask about a ORM, but for me, a QueryBuilder is much easier and more efficient when working with relational databases.
I worked with the notorm library years ago but I don’t know if it is still updated. For input validation I combined it with valitron, then you have a quite slim toolset for validation and database queries …
Thanks for your response. I just want to handle my tables as easy to use models to add OOP for data handling. It really looks like there is no “simple” ORM out there.
Perhaps there really is a gap to be filled with a non-bloated, CRUD- and relation-only oriented ORM. Anyone interested in helping me create such a lib? I’ve already created a simple ORM, but it needs some love before it could be released or go public on GitHub.
What would you recommend as a simple query builder? Is it ok to create a Slim ORM based on DBAL or is there a better alternative?
The danielefavi/slim-orm package looks like a QueryBuilder and not like a ORM to me. The latest release was in 2022, so it might not be maintained anymore (like you said).
What would you recommend as a simple query builder?
I have had the best experience with the cakephp/database package. This is a very good and maintained / supported QueryBuilder from the CakePHP community.
I wrap that Connection class into a QueryFactory class. Example:
But a query builder does not solve my needs to get a simple model layer into my application.
Right now, I have 4 classes to get a custom ORM for my needs (not finalized yet) plus some classes for a custom query builder. I only need to replace the query builder with a proper lib and I’m fine (except my custom ORM is not a well maintained lib).
It really looks like there is no simple and maintained ORM anymore. Idiorm was cool, but it is more dead than alive today.