# ANN: Sequel 2.9.0 Released

**URL:** <https://www.ruby-forum.com/t/ann-sequel-2-9-0-released/157530>\
**Category:** Ruby\
**Created:** [January 12, 2009, 6:53pm UTC](https://www.ruby-forum.com/t/ann-sequel-2-9-0-released/157530 "2009-01-12T18:53:01Z")\
**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:** [January 12, 2009, 6:53pm UTC](https://www.ruby-forum.com/t/ann-sequel-2-9-0-released/157530/1 "2009-01-12T18:53:01Z")

</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.9.0 has been released and should be available on the gem  
mirrors. The 2.9.0 release adds numerous improvements:

## New Features

- Compound SQL statement (i.e. UNION, EXCEPT, and INTERSECT) support  
is much improved. Chaining compound statement calls now longer  
wipes out previous compound statements calls of the same type.  
Also, the ordering of the compound statements is no longer fixed  
per adapter, it now reflects the order they were called on the  
object. For example, the following now work as expected:

- Exception classes ValidationFailure and BeforeHookFailure were  
added so it is eaiser to catch a failed validation. These are  
both subclasses of Sequel::Error, so there shouldn’t be any  
backwards compatibility issues. Error messages are also improved,  
as the ValidationFailure message is a string containing all  
validation failures and the BeforeHookFailure message contains  
which hook type caused the failure (i.e. before\_save,  
before\_create, or before\_validate).

- The sequel command line tool now has a -L option to load  
all files in the given directory. This is mainly useful for  
loading a directory of model files. The files are loaded  
after the database connection is set up.

- Methods to create and drop database functions, triggers, and  
procedural languages were added to the PostgreSQL adapter.

## Other Improvements

- Database#schema now raises an error if you pass a table that  
doesn’t exist. Before, some adapters would return an empty schema.  
The bigger problem with this is that it made table\_exists? return  
the wrong value, since it looks at the Database’s schema.  
Generally, this bug would show up in the following code:

- AlterTableGenerator#add\_foreign\_key now works for MySQL.

- Error messages in model association methods that add/remove an  
associated object are now more descriptive.

- Dataset#destroy for model datasets now works with databases that  
can’t handle nested queries. However, it now loads all model  
objects being destroyed before attempting to destroy any of them.

- Dataset#count now works correctly for compound SQL statements  
(i.e. UNION, EXCEPT, and INTERSECT).

- BigDecimal NaN and (+/-)Infinity values are now literalized  
correctly. Database support for this is hit or miss. Sqlite will  
work correctly, PostgreSQL raises an error if you try to store an  
infinite value in a numeric column (though it works for float  
columns), and MySQL converts all three to 0.

- The SQLite adapter no longer loses primary key information when  
dropping columns.

- The SQLite adapter now supports dropping indicies.

- A bug in the MSSQL adapter’s literalization of LiteralStrings has  
been fixed.

- The literalization of blobs on PostgreSQL (bytea columns) has been  
fixed.

- Sequel now raises an error if you attempt to subclass Sequel::Model  
before setting up a database connection.

- The native postgresql adapter has been changed to only log client  
messages of level WARNING by default. You can modify this via:

- Model#inspect now calls Model#inspect\_values for easier  
overloading.

## Backwards Compatibilty

- The API to Model#save\_failure (a private method) was changed to  
remove the second argument.

- SQLite columns with type numeric, decimal, or money are now  
returned as BigDecimal values. Before, they were probably returned  
as strings.

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)]
