3 ms·
I tend to push SQL fairly hard. As such I find that ORMs are in my way as often as they help. The lack of one doesn't concern me at all. Seriously, how hard
by rarrrrrr 17y ago
I tend to push SQL fairly hard. As such I find that ORMs are in my way as often as they help. The lack of one doesn't concern me at all.
Seriously, how hard is it to compose a SQL query?
- Xichekolas 17y agoAgreed. On that topic, anyone know of a decent mysql lib for ruby that just lets me query and iterate over the results? The one constantly at the top of google results is at tmtm.org, but my understanding is that it's not threadsafe or particularly speedy. I saw something called asymy made by tptacek, but my impression was that the project was abandoned... Thomas, any comment on where that stands?
- jcapote 17y agohave you looked into Sequel? Fast + Thread Safe http://sequel.rubyforge.org/ http://sequel.rubyforge.org/
- jamesbritt 17y agoPerhaps M4DBI http://purepistos.net/m4dbi http://purepistos.net/m4dbi I'm also a fan of Sequel (though I wish it had a different name).
- njm 17y agoIt's not that SQL queries are difficult to compose, it's that ORMs enable different abstractions to emerge, at least when used appropriately; I'll admit though that junior developers are drawn most to ORMs because they limit exposure to SQL. I'd recommend you check out a legitimate ORM that implements the Data Mapper family of design patterns such as SQLAlchemy or Hibernate. (Incidentally, DataMapper in Ruby doesn't in fact implement the Data Mapper pattern, which I find irritating.)
- michaelneale 17y agoI think ORMs do a fine job, excellent even. The problem is that you may be using O's which require a lot of M'ing to from the R's ;) So if you don't do mainstream OO, then you probably don't ever need ORM. SQL databases are powerful relational engines in their own right - many ORMs have to replicate a lot of that functionality into their memory based stuff (which can be good, but its more work). I guess its all slowly fading, as I am led to believe the trend is away from relational data to distributed data, which has a different set of problems...