2 ms·
> ORMs don't try to make a SQL database something else This is simply not true. Many ORMs are designed to abstract away SQL and RDBMS concepts entirely. They
by threeseed 8y ago
> ORMs don't try to make a SQL database something else
This is simply not true.
Many ORMs are designed to abstract away SQL and RDBMS concepts entirely. They deal in objects and object graphs and output SQL which can be quite disjointed from the object model e.g. many-many relationships.
- vinceguidry 8y agoI'm becoming increasingly convinced that there is only one good ORM and the rest are fit only for CRUD operations. ActiveRecord. The abstraction it provides is amazingly flexible. You can be as close to the SQL as you want to be. With other ORMs, any time I need something not CRUD, I wind up hand-generating SQL. With ActiveRecord, I never need to. Looking at generated SQL, I do all the time with AR, happily it makes that very easy for me. Including my own SQL snippets in scopes? Easy. Hand-generating joins? Almost never.
- richmarr 8y ago> This is simply not true. Providing a wrapper around a thing is not the same as wanting to turn a thing into something else. I would argue that ORMs offer cosmetic change. Convenience, not substantive change. > Many ORMs are designed to abstract away SQL and RDBMS concepts entirely. Which ones? Look at their docs and you'll see where conditions, joins, columns, ordering, aggregations, etc. ActiveRecord is probably the most abstract I've seen and the docs still refer endlessly to tables, foriegn keys, etc and show SQL equivalents http://guides.rubyonrails.org/active_record_basics.html#creating-active-record-models http://guides.rubyonrails.org/active_record_basics.html#crea... Here's Hibernate: http://docs.jboss.org/hibernate/orm/5.3/userguide/html_single/Hibernate_User_Guide.html#fetching http://docs.jboss.org/hibernate/orm/5.3/userguide/html_singl... Here's Sequelize: http://sequelize.readthedocs.io/en/v3/docs/querying/#basics http://sequelize.readthedocs.io/en/v3/docs/querying/#basics Here's SQLAlchemy: https://docs.sqlalchemy.org/en/latest/orm/loading_relationships.html https://docs.sqlalchemy.org/en/latest/orm/loading_relationsh... I would say that ORMs as a class rely heavily on SQL and RDBMS concepts... particularly for anything beyond simple CRUD