# ANN: Sequel 0.1.9.6 Released

**URL:** <https://www.ruby-forum.com/t/ann-sequel-0-1-9-6-released/111905>\
**Category:** Ruby\
**Created:** [August 13, 2007, 8:25am UTC](https://www.ruby-forum.com/t/ann-sequel-0-1-9-6-released/111905 "2007-08-13T08:25:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ciconia](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/71c47a/32.png) [@ciconia](https://www.ruby-forum.com/u/ciconia)\
**Post date:** [August 13, 2007, 8:25am UTC](https://www.ruby-forum.com/t/ann-sequel-0-1-9-6-released/111905/1 "2007-08-13T08:25:10Z")

</div>

Sequel version 0.1.9.6 has just been released. This release includes a  
number of big fixes and improvements, among which better schema  
definitions and better paginated datasets. I’d like to thank all of  
the people who made the effort to file bug reports, thus making Sequel  
better.

Following is a discussion of the main changes:

# Improvements to Paginated Datasets

Paginated datasets now provide a bit more information about  
themselves. The new methods are #pagination\_record\_count, #page\_range  
and #current\_page\_record\_range:

# get page 4, 50 records per page

paginated = DB[:items].reverse\_order(:stamp).paginate(4, 50)

# really just a cache of paginated.count

paginated.pagination\_record\_count #=\> 153

# range of available pages

paginated.page\_range #=\> 1…4

# range of records in current page

paginated.current\_page\_record\_range #=\> 151…153

# Refactored Schema Definition Code

The schema definition code has been re-factored and greatly simplified  
in order to provide better support for adapter-specific quirks and  
behaviors. This means that you no longer need to coerce Sequel to do  
what you want. For example, AUTO INCREMENT fields are now done  
correctly for each adapter, and primary keys default to the correct  
adapter-specific definition.

# Support for Specifying Field Sizes and SET/ENUM Columns

Sequel now allows you to specify the field size:

DB.create\_table :items do  
varchar :name, :size =\> 64  
end

Note that if you define a varchar field and don’t specify a size,  
Sequel will assume a field size of 255.

There’s also support for MySQL SET/ENUM fields:

DB.create\_table :items do  
enum :category, :elements =\> [‘ruby’, ‘java’, ‘other’]  
end

# Sequel.dbi Convenience Method

DBI users now have an easier way to open databases using DBI. The old  
method involved doing something ugly like:

Sequel.open ‘dbi:/ado’, {  
:database =\>  
‘DBI:ADO:Provider=SQLNCLI;Data Source=(local)  
\sqlexpress;Integrated Security=SSPI’  
}

The new Sequel.dbi method makes it look nicer:

Sequel.dbi ‘ADO:Provider=SQLNCLI;Data Source=(local)  
\sqlexpress;Integrated Security=SSPI’

# Miscellanea

- Changed MySQL adapter to automatically reconnect (issue #26).

- Changed Sequel() to acccept variable arity.

=============================================

Sequel project page:  
[http://code.google.com/p/ruby-sequel](http://code.google.com/p/ruby-sequel)

Sequel documentation:  
[http://sequel.rubyforge.org](http://sequel.rubyforge.org)

Join the Sequel-talk group:  
[http://groups.google.com/group/sequel-talk](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](http://ruby-sequel.googlecode.com/svn/trunk) sequel  
cd sequel  
rake install
