4 ms·
Hi, I answered about “pure Python” obsession in a separate comment ;) > you're still littering Python with SQL keywords like order_by(), desc(), select(), and
by kozlovsky 13y ago
Hi, I answered about “pure Python” obsession in a separate comment ;)
> you're still littering Python with SQL keywords like order_by(), desc(), select(), and commit()
Well, I see them not as “SQL keywords” but as logical concepts
> The GROUP BY section of the documentation just reads like a rough translation of SQL into Python
Hmm, not sure I understand this. With PonyORM, GROUP BY section is generated automatically, and not present in Pony ORM queries. This eliminates the need to duplicate the same columns in SELECT and GROUP BY sections.
> Beyond a certain level of complexity, you need to know SQL in order to write complex queries.
I agree with this. But I hope PonyORM can lower entry barrier for new developers. Also, PonyORM allows developers to use pure SQL, if all they need from mapper is IdentityMap, caching, etc.
> By the way, why is there an order_by() method and a separate orderby() method?
Thanks for noticing this, it is a typo in documentation. The method was renamed from orderby() to order_by() recently.
- kijin 13y agoHere's an example from the documentation that just reads like a "rough translation of SQL into Python": select((item.order, item.order.total_price, sum(item.price * item.quantity)) for item in OrderItem if item.order.total_price < sum(item.price * item.quantity))
- kozlovsky 13y agoWell, it doesn't seems that "rough" to me, because content of GROUP BY and HAVING sections is determined automatically and there is no need to manually join tables