# ANN: Sequel 3.8.0 Released

**URL:** <https://www.ruby-forum.com/t/ann-sequel-3-8-0-released/181058>\
**Category:** Ruby\
**Created:** [January 4, 2010, 7:15pm UTC](https://www.ruby-forum.com/t/ann-sequel-3-8-0-released/181058 "2010-01-04T19:15:48Z")\
**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 4, 2010, 7:15pm UTC](https://www.ruby-forum.com/t/ann-sequel-3-8-0-released/181058/1 "2010-01-04T19:15:48Z")

</div>

Sequel is a lightweight database access toolkit for Ruby.

- 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, stored procedures, 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, Amalgalite, DataObjects,  
DB2, DBI, Firebird, Informix, JDBC, MySQL, ODBC, OpenBase, Oracle,  
PostgreSQL and SQLite3.

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

## New Features

- Dataset#each\_server was added, allowing you to run the same query  
(most likely insert/update/delete) on all shards. This is useful  
if you have a sharded database but have lookup tables that should  
be identical on all shards. It works by yielding copies of the  
current dataset that are tied to each server/shard:

- Database#each\_server was added, allowing you to run schema  
modification methods on all shards. It works by yielding a  
new Sequel::Database object for each shard, that will connect to  
only that shard:

- You can now add and remove servers/shards from the connection  
pool while Sequel is running:

- When you attempt to disconnect from a server that has connections  
currently in use, Sequel will now schedule those connections to  
be disconnected when they are returned to the pool. Previously,  
Sequel disconnected available connections, but ignored connections  
currently in use, so it wasn’t possible to guarantee complete  
disconnection from the server. Even with this new feature, you can  
only guarantee eventual disconnection, since disconnection of  
connections in use happens asynchronously.

- Database#disconnect now accepts a :servers option specifying the  
server(s) from which to disconnect. This should be a symbol or  
array of symbols representing servers/shards. Only those specified  
will be disconnected:

- A validates\_type validation was added to the validation\_helpers  
plugin. It allows you to check that a given column contains  
the correct type. I can be helpful if you are also using the  
serialization plugin to store serialized ruby objects, by making  
sure that the objects are of the correct type (e.g. Hash):

- Sequel::SQL::Expression#== is now supported for all expressions:

- When using the generic File type to create blob columns on  
MySQL, you can specify the specific database type by using the  
:size option (with :tiny, :medium, and :long values recognized):

- The mysql adapter will now default to using mysqlplus, falling  
back to use mysql. mysqlplus is significantly better for threaded  
code because queries do not block the entire interpreter.

- The JDBC adapter is now able to detect certain types of disconnect  
errors.

- ConnectionPool.servers and Database.servers were added, which  
return an array of symbols specifying the servers/shards in use.

## Other Improvements

- The single-threaded connection pool now raises  
DatabaseConnectionErrors if unable to connect, so it now operates  
more similarly to the default connection pool.

- The single-threaded connection pool now operates more similar  
to the default connection pool when given a nonexistent server.

- PGErrors are now correctly converted to DatabaseErrors in the  
postgres adapter when preparing statements or executing prepared  
statements.

- DatabaseDisconnectErrors are now raised correctly in the postgres  
adapter if the connection status is not OK after a query raises an  
error.

- In the mysql adapter, multiple statements in a single query should  
now be handled correctly in the all cases, not just when using  
Dataset#each. So you can now submit multiple queries in a single  
string to Database#run.

- Model object creation on Microsoft SQL Server 2000 once again  
works correctly. Previously, an optimization was used that was  
only supported on 2005+.

- Backslashes are no longer doubled inside string literals when  
connecting to Microsoft SQL Server.

- The ORDER clause now correctly comes after the HAVING clause on  
Microsoft SQL Server.

- Sequel now checks that there is an active transaction before  
rolling back transactions on Microsoft SQL Server, since  
there are cases where Microsoft SQL Server will roll back  
transactions implicitly.

- Blobs are now handled correctly when connecting to H2.

- 64-bit integers are now handled correctly in JDBC prepared  
statements.

- In the boolean\_readers plugin, correctly handle columns not in  
the db\_schema, and don’t raise an error if the model’s columns  
can’t be determined.

- In the identity\_map plugin, remove instances from the cache if they  
are deleted or destroyed.

## Backwards Compatibility

- Dataset::FROM\_SELF\_KEEP\_OPTS was merged into  
Dataset::NON\_SQL\_OPTIONS. While used in different places, they  
were used for the same purpose, and entries missing from one should  
have been included in the other.

- The connection pool internals changed substantially. Now,  
ConnectionPool #allocated and #available\_connections will return  
nil instead of an array or hash if they are called with a  
nonexistent server. These are generally only used internally,  
though they are part of the public API. #created\_count and #size  
still return the size of the :default server when called with a  
nonexistent server, though.

- The meta\_eval and metaclass private methods were removed from  
Sequel::MetaProgramming (only the meta\_def public method remains).  
If you want these methods, use the metaid gem.

- The irregular ox-\>oxen pluralization rule was removed from the  
default inflections, as it screws up the more common box-\>boxes.

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