[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Ruby and Databases

Brian Ross

8/18/2008 3:21:00 AM

[Note: parts of this message were removed to make it a legal post.]

Is there a book or another collection of suggested readings for learning how
to manipulate a database with ruby? I've gotten to the point where I can
take a CSV file, store it as an associative array, but now I'd like to take
that and put it into a database (postgresql). Is there a sample of commented
code to take a look at? Otherwise, I'm happy to read a few books or articles
and piece what I need together.

Brian

1 Answer

Avdi Grimm

8/18/2008 3:38:00 AM

0

On Sun, Aug 17, 2008 at 11:20 PM, Brian Ross <p.brian.ross@gmail.com> wrote:
> Is there a book or another collection of suggested readings for learning how
> to manipulate a database with ruby? I've gotten to the point where I can
> take a CSV file, store it as an associative array, but now I'd like to take
> that and put it into a database (postgresql). Is there a sample of commented
> code to take a look at? Otherwise, I'm happy to read a few books or articles
> and piece what I need together.

These days perhaps the most common way to deal with databases in Ruby
is using the ActiveRecord library (http://ar.rubyon...), which
originated as part of the Rails web framework. You will find loads of
ActiveRecord documention both on the web and in any book about Rails.

That's not the only way, however. There are other Object-Relational
mapping layers (ORMs), such as DataMapper (http://datam...).
If you're not necessarily looking for an ORM, you just want to
manipulate databases from Ruby, you might look into Sequel
(http://sequel.ruby...). Or, if you want to take a more
traditional approach, Ruby-DBI (http://ruby-dbi.ruby...) is one
of the most mature Ruby/database libraries.


--
Avdi

Home: http:...
Developer Blog: http:.../devblog/
Twitter: http://twitte...
Journal: http://avdi.livej...