From: Sharon Rosner Date: 2007-12-25T06:18:32+09:00 Subject: Re: Ruby DBI > What's the best way to do raw SQL in Ruby? Something like Perl's DBI. I see there is aRuby DBIbut it seems in beta. Can one You can give Sequel a try. it provides a simple way to connect to databases, and you can run raw SQL statements: require 'sequel' DB = Sequel('postgres://localhost/mydb') DB['select * from my_table'].each do |row| p row end You can also specify your queries in Ruby: DB[:items].filter {:category == 'ruby' && :price < 100}.order(:name).each do |row| p row end More info here: http://code.google.com/p/ruby-sequel http://sequel.rubyforge.org http://groups.google.com/group/sequel-talk