Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > ANN: Sequel 0.3.2 Released

Reply
Thread Tools

ANN: Sequel 0.3.2 Released

 
 
ciconia@gmail.com
Guest
Posts: n/a
 
      11-01-2007
Sequel version 0.3.2 has just been released. This release includes new
Dataset functionality, magic methods and a few other minor
improvements and bug fixes.

Following is a discussion of the changes:

=== New Dataset functionality

A few new methods have been added to the Dataset class. The
#group_and_count methods returns a dataset grouped by the given
column, along with a count for each group:

posts.group_and_count(:category).sql
#=> "SELECT category, count(category) AS count FROM posts GROUP BY
category ORDER BY count"

The #range method returns a Range object made from the minimum and
maximum values for the given column:

posts.filter(:category => 'ruby').range(:view_count)
#=> 11..35

The #interval method returns the interval between the minimum and
maximum values for the given column:

posts.filter(:category => 'ruby').interval(:view_count)
#=> 24

=== Dataset magic methods

The Dataset class now supports magic methods: order_by_xxx,
first_by_xxx, last_by_xxx, filter_by_xxx, group_by_xxx and
count_by_xxx. These methods can be used :

posts.order_by_stamp.sql
#=> "SELECT * FROM posts ORDER BY stamp"

posts.first_by_stamp #=> first row ordered by stamp
posts.last_by_stamp #=> last row ordered by stamp

posts.filter_by_category('ruby').sql
#=> "SELECT * FROM posts WHERE (category = 'ruby')"

posts.group_by_category.sql
#=> "SELECT * FROM posts GROUP BY category"

posts.count_by_category.sql
#=> "SELECT category, count(category) AS count FROM posts GROUP BY
category ORDER BY count"

=== Other improvements and bug fixes

* Model.create and Model.new can now accept a block:

Post.new do |p|
p.title = "Hello world"
p.save
end

* Added Dataset#set as alias to Dataset#update.

* Fixed Oracle:atabase#execute (#84).

* Fixed timestamp translation in SQLite adapter (#83).

* Experimental DB2 adapter.

* Removed long deprecated expressions.rb code.

* More documentation.

* Revised code to refer to 'columns' instead of 'fields'.

=== More info

Sequel project page:
<http://code.google.com/p/ruby-sequel>

Sequel documentation:
<http://sequel.rubyforge.org>

Join the Sequel-talk group:
<http://groups.google.com/group/sequel-talk>

Install the gem:
sudo gem install sequel

Or check out the source and install manually:
svn co http://ruby-sequel.googlecode.com/svn/trunk sequel
cd sequel
rake install


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ANN: Sequel 0.1.3 Released - now with DBI support! Sharon Rosner Ruby 0 05-20-2007 11:33 AM
ANN: Sequel 0.1.2 Released Sharon Rosner Ruby 0 05-19-2007 01:08 PM
ANN: Sequel 0.1.0 Released Sharon Rosner Ruby 0 04-22-2007 07:20 PM
ANN: Sequel 0.0.20 Released Sharon Rosner Ruby 0 04-18-2007 08:57 PM
ANN: Sequel 0.0.19 Released and Sequel discussion list Sharon Rosner Ruby 0 04-16-2007 09:48 AM



Advertisments