Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
Re: Ruby DBI
Sharon Rosner
12/24/2007 9:19:00 PM
> 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/r...
http://sequel.rub...
http://groups.google.com/group/s...
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Re: Ruby DBI
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password