News for hackers. Stuff that matters.
Re:To ORM or Not to ORM by mireq on Tuesday May 07, 2019 @01:45PM (#19851709)
I am very happy with ORM.

I'm currently working on an e-shop. I need to display many tables with different filters.

Administrator wants products starting with string? OK: if filter['category']: qs = qs.filter ... Administrator wants products without category? Ok: if filter['category']: qs = qs.filter ... Add multilang supprt? Ok: subclass model, mark fields and translatable, run migrate script

I can combine any filters, ORM automatically creats query with necessary joins, subqueries, group by expressions etc.

If i didn't use ORM i would have to write code that generate select with cca 200 ifs because almost every filter can generate join or add fields to group by or generate subselect etc.

Re:To ORM or Not to ORM by scarface74 on Tuesday May 07, 2019 @01:57PM (#19851837)
This is about the only use case where I find ORMs useful
Re:To ORM or Not to ORM by snuxoll on Tuesday May 07, 2019 @03:02PM (#19852389)
Also a problem solved by less magic libraries, like MyBatis, jOOQ, SQLAlchemy Core, etc.
Re:To ORM or Not to ORM by collyw on Tuesday May 07, 2019 @05:58PM (#19853834)
Inserting data into the database is usually where ORM's save the most time.