# from SQLAlchemy: # http://www.sqlalchemy.org/docs/dbengine.myt#dbengine DB = ServerSide::Database.new('postgres://postgres:240374@localhost:5432/reality_production') DB = ServerSide::Database.new('postgres://localhost/reality_production') DB = ServerSide::Database.new('sqlite:///~/tmp/mydb.sqlite') DB = ServerSide::Database.connect('postgres://localhost/reality_production') DB[:posts].count #=> posts = DB[:posts] posts.filter(:author => 'sharon').all posts.each {|p| puts p[:title]} posts.inject({}) {|m, p| m[p[:date]] = p[:title]; m} # or posts.hash(:date, :title) posts.