# ANN: Sequel 3.13.0 Released

**URL:** <https://www.ruby-forum.com/t/ann-sequel-3-13-0-released/190961>\
**Category:** Ruby\
**Created:** [July 1, 2010, 5:31pm UTC](https://www.ruby-forum.com/t/ann-sequel-3-13-0-released/190961 "2010-07-01T17:31:11Z")\
**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:** [July 1, 2010, 5:31pm UTC](https://www.ruby-forum.com/t/ann-sequel-3-13-0-released/190961/1 "2010-07-01T17:31:11Z")

</div>

Sequel is a lightweight database access toolkit for Ruby.

- Sequel provides thread safety, connection pooling and a concise  
DSL for constructing SQL queries and table schemas.
- Sequel includes a comprehensive ORM layer for mapping records to  
Ruby objects and handling associated records.
- Sequel supports advanced database features such as prepared  
statements, bound variables, stored procedures, savepoints,  
two-phase commit, transaction isolation, master/slave  
configurations, and database sharding.
- Sequel currently has adapters for ADO, Amalgalite, DataObjects,  
DB2, DBI, Firebird, Informix, JDBC, MySQL, ODBC, OpenBase, Oracle,  
PostgreSQL and SQLite3.

Sequel 3.13.0 has been released and should be available on the gem  
mirrors.

= New Plugins

- A json\_serializer plugin was added that allows you to serialize  
model instances or datasets to JSON using to\_json. It requires  
the json library. The API was modeled on ActiveRecord’s JSON  
serialization support. You can use :only and :except options  
to specify the columns included, :include to specify associations  
to include, as well pass options to nested associations using a  
hash. In addition to serializing to JSON, it also adds support  
for parsing JSON to model objects via JSON.parse or #from\_json.

- An xml\_serializer plugin was added that allows you to serialize  
model instances or datasets to XML. It requries the nokogiri  
library. It has a similar API to the json\_serializer plugin, using  
to\_xml instead of to\_json, and the from\_xml class method instead  
of JSON.parse.

- A tree plugin was added that allows you to treat Sequel::Model  
objects as being part of a tree. It provides similar features to  
rcte\_tree, but works on databases that don’t support recursive  
common table expressions. In addition to the standard parent  
and children associations, it provides instance methods to get  
the ancestors, descendants, and siblings of the given tree node,  
and class methods to get the roots of the tree.

- A list plugin was added that allows you to treat Sequel::Model  
objects as being part of a list. This adds instance methods to  
get the next and prev items in the list, or to move the item  
to a specific place in the list. You can specify that all rows  
in the table belong to the same list, or specify arbitrary scopes  
so that the same table can contain many separate lists.

= Other New Features

- Sequel is now compatible with Ruby 1.9.2pre3.

- Sequel now supports prepared transactions/two-phase commit on  
PostgreSQL, MySQL, and H2. You can specify that you want to  
use prepared transactions using the :prepare option which  
should be some transaction id string:

- Sequel now supports customizable transaction isolation levels on  
PostgreSQL, MySQL, and Microsoft SQL Server. You can specify the  
transaction isolation level to use for any transaction using the  
:isolation option with an :uncommitted, :committed, :repeatable,  
or :serializable value:

- You can specify a NULLS FIRST/LAST ordering by using the  
:nulls=\>:first/:last option to asc and desc:

- Sequel::Model.find\_or\_create now accepts a block that is a yielded  
a new model object to be created if an existing model object is  
not found.

- The :frame option for windows and window functions can now be a  
string that is used literally in the SQL. This is necessary if you  
want to specify a custom frame, such as one that uses a specific  
number of rows preceding or following.

- Savepoints are now supported on H2.

- A :methods\_module association option was added, allowing you to  
specify the module into which association instance methods are  
placed. By default, it uses the module containing the column  
accessor methods.

= Other Improvements

- The :encoding option for the native MySQL adapter should now work  
correctly in all cases. This fix was included in 3.12.1.

- Sequel now handles arrays of two element arrays automatically when  
using them as the value of a filter hash:

- Sequel no longer attempts to use class polymorphism in the  
class\_table\_inheritance plugin if you don’t specify a cti\_key.

- When using the native SQLite adapter, prepared statements are now  
cached per connection for increased performance. Previously,  
Sequel prepared a new statement for every query.

- tinyint(1) columns are now handled as booleans when connecting to  
MySQL via JDBC.

- On PostgreSQL, if no :schema option is provided for  
Database#tables, #table\_exists?, or #schema, and no default\_schema  
is used, assume all schemas except the default non-public ones.  
Previously, it assumed the public schema for tables and  
table\_exists?, but did not assume any schema for #schema.

- Unsigned integers are now handled correctly in the schema dumper.

- Sequel::SQL::PlaceholderLiteralString is now a GenericExpression  
subclass, allowing you to treat it like most other Sequel  
expression objects:

- Sequel now supports the bitwise shift operators (\<\< and \>\>) on  
Microsoft SQL Server by emulating them.

- Sequel now supports most bitwise operators (&, |, ^, \<\<, \>\>) on H2  
by emulating them. The bitwise complement operator is not yet  
supported.

- Sequel now logs the SQL queries that are sent when connecting to  
MySQL.

- If a plugin cannot be loaded, Sequel now gives a more detailed  
error message.

= Backwards Compatibility

- Array#sql\_array and the Sequel::SQL::SQLArray class are now  
considered deprecated. Use the Array#sql\_value\_list and the  
Sequel::SQL::ValueList class instead. SQLArray is now just  
an alias for ValueList, but it now is an Array subclass instead  
of a Sequel::SQL::Expression subclass.

- Using the ruby bitwise xor operator (^) on PostgreSQL now uses  
PostgreSQL’s bitwise xor operator (#) instead of PostgreSQL’s  
exponentiation operator (^). If you want exponentiation, use  
the power function.

- Using the ruby bitwise complement operator (~) on MySQL now returns  
a signed integer instead of an unsigned integer, for better  
compatibility with other databases.

- Using nil as a case expression value (the 2nd argument to Hash#case  
and Array#case) will now use NULL as the case expression value,  
instead of omitting the case expression value:

- Some internal transaction methods now take an optional options  
hash, so if you have a custom adapter, you will need to make  
changes.

- Some internal association methods now take an optional options  
hash.

- Some Rakefile task names were modified in the name of consistency:

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)]
- {Blog}[[http://sequel.heroku.com](http://sequel.heroku.com)]
- {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)]
