From: Sharon Rosner Date: 2007-10-17T13:44:05+09:00 Subject: Re: recommendations for working with PostgreSQL > I have need to work with PostgreSQL via Ruby. What gems/modules do you > recommend? Are there any quickstart-type howtos online to which you > might direct me? First you need to install the postgres driver: sudo gem install postgres As far as ORM's go, may I suggest Sequel: require 'sequel/postgres' DB = Sequel('postgres://rthompso:rthompso@127.0.0.1/test') DB.create_table :items do # Create a new table column :name, :text column :price, :float end items = DB[:items] # Create a dataset # Populate the table items << {:name => 'abc', :price => rand * 100} items << {:name => 'def', :price => rand * 100} items << {:name => 'ghi', :price => rand * 100} puts "Count of items: #{items.count}" puts "All items:" items.reverse_order(:price).print puts "The average price is: #{items.avg(:price)}" puts "All items with price under 50" items.filter {:price < 50}.print You can find more information here: http://code.google.com/p/ruby-sequel/ Or on sequel-talk: http://groups.google.com/group/sequel-talk best Sharon