# ANN: Sequel 3.0.0 Released

**URL:** <https://www.ruby-forum.com/t/ann-sequel-3-0-0-released/167151>\
**Category:** Ruby\
**Created:** [May 4, 2009, 7:36pm UTC](https://www.ruby-forum.com/t/ann-sequel-3-0-0-released/167151 "2009-05-04T19:36:45Z")\
**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:** [May 4, 2009, 7:36pm UTC](https://www.ruby-forum.com/t/ann-sequel-3-0-0-released/167151/1 "2009-05-04T19:36:45Z")

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

## Deprecated Methods/Features Removed

Methods and features that were deprecated in 2.12.0 have been removed  
in 3.0.0. Many features were moved into plugins or extensions, so in  
many cases you just need to require an extension or use Model.plugin  
and not make any changes to your code. See the 2.12.0 release notes  
for the list of methods/features deprecated in 2.12.0.

If you are upgrading from a previous 2.x release, please upgrade to  
2.12.0 first, fix your code to remove all deprecation warnings, and  
then upgrade to 3.0.0.

## New Adapter

- Sequel now has an Amalgalite adapter. Amalgalite is a ruby  
extension that embeds SQLite without requiring a separate SQLite  
installation. The adapter is functionality complete but  
significantly slower than the native SQLite adapter.

## New Features

- The JDBC, PostgreSQL, MySQL, and SQLite adapters all now have a  
Database#indexes method that returns indexes for a given table:

- A schema\_dumper extension was added to Sequel. It supports dumping  
the schema of a table (including indexes) as a string that can be  
evaluated in the context of a Database object to create the table.  
It also supports dumping all tables in the database as a string  
containing a Migration subclass that will rebuild the database.

- Using options with the generic database types is now supported to  
a limited extent. For example, the following code now works:

- Using Dataset#filter and related methods with multiple arguments  
now works much more intuitively:

- You can now create temporary tables by passing the :temp=\>true  
option to Database#create\_table.

- The Oracle shared adapter now supports emulation of  
autoincrementing primary keys by creating a sequence and a trigger,  
similar to how the Firebird adapter works.

- The Database#database\_type method was added that returns a symbol  
specifying the database type being used. This can be different  
than Database.adapter\_scheme if you are using an adapter like  
JDBC that allows connecting to multiple different types of  
databases.

- Database#drop\_index and related methods now support an options  
hash that respects the :name option, so they can now be used to  
drop an index that doesn’t use the default index name.

- The PostgreSQL shared adapter now supports a  
Database#reset\_primary\_key\_sequence method to reset the  
primary key sequence for a given table, based on code from  
ActiveRecord.

- SQL::QualifiedIdentifiers can now be qualified, allowing you to do:

- Using the :db\_type=\>‘mssql’ option with the DBI adapter will now  
load the MSSQL support.

- The MySQL shared adapter now supports Dataset#full\_text\_sql, which  
you can use in queries like the following:

## Other Improvements

- Sequel will now release connections from the connection pool  
automatically if they are held by a dead thread. This can happen  
if you are using MRI 1.8 and you are heavily multithreaded or  
you call Thread#exit! or similar method explicitly. Those methods  
skip the execution of ensure blocks which normally release the  
connections when the threads exit.

- Model#save will now always use the same server when refreshing data  
after an insert. This fixes an issue when Sequel’s master/slave  
database support is used with models.

- SQL Array references are now quoted correctly, so code like this  
now works:

- The PostgreSQL shared adapter now handles sequences that need to be  
quoted correctly (previously these were quoted twice).

- String quoting on Oracle no longer doubles backslashes.

- Database#count now works correctly when used on MSSQL when using  
an adapter that doesn’t handle unnamed columns.

- Full text searching in the MySQL adapter now works correctly when  
multiple search terms are used.

- Altering a column’s name, type, default, or NULL/NOT NULL status  
on MySQL now keeps other relevent column information. For example,  
if you alter a column’s type, it’ll keep an existing default. This  
functionality isn’t complete, there may be other column information  
that is lost.

- Fix creation of an index with a given type on MySQL, since MySQL’s  
documentation lies.

- The schema parser now handles decimal types with size specifiers,  
fixing use on MySQL.

- Dataset#quote\_identifier now works correctly when given an  
SQL::Identifier. This allows you to do:

## Backwards Compatibility

- Sequel will now use instance\_eval on all virtual row blocks without  
an argument. This can lead to much nicer code:

- Dataset#exclude now inverts the given argument, instead of negating  
it. This only changes its behavior if it is called with a hash or  
array of all two pairs that have more than one element.

- As noted above, the methods/features deprecated in 2.12.0 were  
removed.

- The private Dataset#select\_\*\_sql methods now only take a single  
argument, the SQL string being built.

- Dataset#from when called without arguments would previously cause an  
error to be raised when the SQL string is generated. Now it causes  
no FROM clause to be used, similar to how Dataset#select with no  
arguments causes SELECT \* to be used.

- The internals of the generic type support and the schema generators  
were changed significantly, which could have some fallout in terms  
of old migrations breaking if they used the generic types and were  
relying on some undocumented behavior (such as using Integer as a  
type with the :unsigned option).

- The Firebird adapter no longer translates the text database  
specific type. Use the following instead:

- The MySQL shared adapter used to use the timestamp type for Time,  
now it uses datetime. This is because the timestamp type cannot  
represent everything that the ruby Time class can represent.

- Metaprogramming#metaattr\_accessor and #metaattr\_reader methods were  
removed.

- Dataset#irregular\_function\_sql was removed.

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