4 ms·
The problem is that, plainly, your ORM sucks. Serious ORMS allow you to inject custom SQL and still return objects; many can just take the result of a plain SQL
by Daishiman 15y ago
The problem is that, plainly, your ORM sucks. Serious ORMS allow you to inject custom SQL and still return objects; many can just take the result of a plain SQL query and map it to objects as you please.
Really, there are good and bad ORMs. Bad ORMs produce the results you mention. Good ones are much more adaptable.
- dkubb 15y agoThe DataMapper ORM allows you to use SQL but still return domain objects: http://rubydoc.info/github/datamapper/dm-ar-finders/master/DataMapper/Model:find_by_sql http://rubydoc.info/github/datamapper/dm-ar-finders/master/D... Maybe the gp doesn't know about it or chooses not to use it, but it exists.
- apsurd 15y agothanks for this! You are right I had no idea this existed. Just goes to show I really should read the source over depending on datamapper.org/docs/ too much.