Database queries in Ruby
Sunday, April 6th, 2008I just ran across Ambition, and it’s the coolest Ruby project I’ve seen in a while.
One of my complaints about Ruby has long been SQL. I’ve never quite been able to quite wrap my head around all of ActiveRecord’s query capabilities, so (unless I’m doing something trivial) I basically have to write an SQL query, and then port it to ActiveRecord. And then, what’s the point? Is a bunch of lines like “:joins => ‘LEFT OUTER JOIN foo ON foo.x_id = bar.id’” really an improvement over just writing straight SQL?
So, depending on how Ambition works, it could be either “even more useless than ActiveRecord” or “the coolest Ruby library ever”. If I still have to think in SQL and mentally convert that to Ambition, there’s no point. But if it can generate reasonable SQL queries for a wide spectrum of cases, given fairly natural Ruby code, this would be awesome.
Definitely a project to watch!
