ANN: Sequel 0.3.2 Released

Discussion in 'Ruby' started by ciconia@gmail.com, Nov 1, 2007.

  1. Guest

    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::Database#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
     
    , Nov 1, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sharon Rosner
    Replies:
    0
    Views:
    164
    Sharon Rosner
    Apr 16, 2007
  2. Sharon Rosner

    ANN: Sequel 0.0.20 Released

    Sharon Rosner, Apr 18, 2007, in forum: Ruby
    Replies:
    0
    Views:
    117
    Sharon Rosner
    Apr 18, 2007
  3. Sharon Rosner

    ANN: Sequel 0.1.0 Released

    Sharon Rosner, Apr 22, 2007, in forum: Ruby
    Replies:
    0
    Views:
    108
    Sharon Rosner
    Apr 22, 2007
  4. Sharon Rosner

    ANN: Sequel 0.1.2 Released

    Sharon Rosner, May 19, 2007, in forum: Ruby
    Replies:
    0
    Views:
    128
    Sharon Rosner
    May 19, 2007
  5. Sharon Rosner
    Replies:
    0
    Views:
    117
    Sharon Rosner
    May 20, 2007
Loading...

Share This Page