5 ms·
Good question. I can't speak for all ORMs, but both SQLAlchemy and Core Data provide direct support for self-referential relationships SQLAlchemy lets you drop
by stevenwei 14y ago
Good question. I can't speak for all ORMs, but both SQLAlchemy and Core Data provide direct support for self-referential relationships
SQLAlchemy lets you drop down to raw SQL as well if you need to, while still taking care of mapping the result set to objects for you.
Core Data is less powerful (and technically not an ORM), but it's the defacto standard on iOS so I'm pretty much stuck with it.
- einhverfr 14y agoSo if you have self-referential relationships of arbitrary depth then can it generate clauses like WITH RECURSIVE or CONNECT BY? Or are you functionally limited to one level of self-joins without dropping to SQL?
- stevenwei 14y agoWITH RECURSIVE is supported in SQLAlchemy now, although the syntax is rather verbose. Not sure about CONNECT BY, I think you may need to drop to SQL for that.
- einhverfr 14y agothat's pretty cool. (I would assume that since WITH RECURSIVE is the standard and CONNECT BY is Oracle's invention that either it would be handled by db-specific extensions or just be another cost of running Oracle)