Chris Wanstrath brings his own solution: Ambition. Ambition takes advantage of ParseTree to walk the parse tree and translate plain Ruby queries into SQL (when the target is a Relational Database), so at the end you'll be able to write your queries the Ruby way:
User.first
# which will translate into "SELECT * FROM users LIMIT 1"
User.select { |u| u.karma > 20 }.sort_by(&:karma).first(5)
# which will translate into "SELECT * FROM users WHERE (users.`karma` > 20)
# ORDER BY users.karma LIMIT 5"
While originally Chris was gunning for Rack, he changed his target since he discovered LINQ.
We’ve moved our sights from Rack to LINQ. That is, we don’t want to only support other ORMs—we want Ambition to be a query language for SQL, LDAP, XPath, the works. The 1.0 release will be backend-agnostic. Maybe then we’ll change the name to Hubris? Time will tell.You can find latest sources at
git://errtheblog.com/git/ambition