# ANN: Sequel 2.5.0 Released

**URL:** <https://www.ruby-forum.com/t/ann-sequel-2-5-0-released/147640>\
**Category:** Ruby\
**Created:** [September 3, 2008, 9:46pm UTC](https://www.ruby-forum.com/t/ann-sequel-2-5-0-released/147640 "2008-09-03T21:46:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nerdmaster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/c68b51/32.png) [@nerdmaster](https://www.ruby-forum.com/u/nerdmaster)\
**Post date:** [September 3, 2008, 9:46pm UTC](https://www.ruby-forum.com/t/ann-sequel-2-5-0-released/147640/1 "2008-09-03T21:46:39Z")

</div>

- Sequel provides thread safety, connection pooling and a concise DSL  
for constructing database queries and table schemas.
- Sequel also includes a lightweight but comprehensive ORM layer for  
mapping records to Ruby objects and handling associated records.
- Sequel supports advanced database features such as prepared  
statements, bound variables, master/slave configurations, and  
database sharding.
- Sequel makes it easy to deal with multiple records without having  
to break your teeth on SQL.
- Sequel currently has adapters for ADO, DB2, DBI, Informix, JDBC,  
MySQL, ODBC, OpenBase, Oracle, PostgreSQL and SQLite3.

Sequel 2.5.0 has been released and should be available on the gem  
mirrors. The 2.5.0 release adds numerous minor features and  
improvements:

## New Features

- The values that are used to insert/update records can now be  
scoped similar to how filter expressions can be scoped.  
set\_defaults is used to set defaults which can be overridden,  
and set\_overrides is used to set defaults which cannot be  
overridden:

- The schema generators now support creating and altering tables  
with composite primary and/or foreign keys:

- The AlterTableGenerator now supports unique constraints:

- The schema generators now support ON UPDATE (previously, they only  
supported ON DELETE):

- When connecting to a PostgreSQL server version 8.2 and higher,  
Sequel now uses the INSERT … RETURNING … syntax, which should  
speed up row inserts on PostgreSQL. In addition, Sequel Models  
use RETURNING \* to speed up model object creation.

- You can now validate multiple attributes at once. This is useful  
if the combination of two or more attribute values is important,  
such as checking the uniqueness of multiple columns.  
validates\_uniqueness\_of now supports this directly:

## Other Improvements

- Dataset methods insert\_sql, delete\_sql, and update\_sql respect the  
:sql option, allowing you to do things such as:

- The database adapters (at least MySQL, PostgreSQL, SQLite, and  
JDBC) generally raise Sequel::DatabaseError for database problems,  
making it easier to tell what is a true database error versus an  
error raised by Sequel itself.

- Sequel uses the async features of ruby-pg so that the entire  
interpreter is not blocked while waiting for the results of  
queries.

- Sequel now supports the 2008.08.17 version of ruby-pg.

- MSSQL support has been improved when using the ODBC and ADO  
adapters.

- Index names are quoted and creating or dropping indexes.

- Automatically generated column accessor methods no longer override  
instance methods specified by plugins.

- Inserting a row with an already specified primary key inside a  
transaction now works correctly when using PostgreSQL.

- before\_save and before\_update hooks now work as expected when using  
save\_changes.

- count and paginate now work correctly on graphed datasets.

## Backwards Compatibility

- The SQLite adapter now raises Sequel::DatabaseError instead of  
Sequel::Error::InvalidStatement whenever an SQLite3::Exception is  
raised by the SQLite3 driver.

- Date and DateTime conversions now convert 2 digit years. To revert  
to the previous behavior:

- You can no longer abuse the SQL function syntax for specifying  
database types. For example, you must change:

If you have any questions, please post on the Google Group.

Thanks,  
Jeremy

- {Website}[[http://sequel.rubyforge.org](http://sequel.rubyforge.org)]
- {Source code}[[GitHub - jeremyevans/sequel: Sequel: The Database Toolkit for Ruby](http://github.com/jeremyevans/sequel)]
- {Bug tracking}[[Google Code Archive - Long-term storage for Google Code Project Hosting.](http://code.google.com/p/ruby-sequel/issues/list)]
- {Google group}[[http://groups.google.com/group/sequel-talk](http://groups.google.com/group/sequel-talk)]
- {RDoc}[[http://sequel.rubyforge.org/rdoc](http://sequel.rubyforge.org/rdoc)]
