# ANN: Sequel 2.3.0 Released

**URL:** <https://www.ruby-forum.com/t/ann-sequel-2-3-0-released/144172>\
**Category:** Ruby\
**Created:** [July 26, 2008, 5:31am UTC](https://www.ruby-forum.com/t/ann-sequel-2-3-0-released/144172 "2008-07-26T05:31:53Z")\
**Posts on this page:** 2\
**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 26, 2008, 5:31am UTC](https://www.ruby-forum.com/t/ann-sequel-2-3-0-released/144172/1 "2008-07-26T05:31:53Z")

</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 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.3.0 has been released and should be available on the gem  
mirrors. The 2.3.0 release focuses mainly on compatibility, and  
offers the following improvements:

## JRuby and Ruby 1.9 Officially Supported

Sequel now officially supports JRuby 1.1.3 and Ruby 1.9 (svn revision  
18194 at least). Using JRuby with the JDBC adapter, PostgreSQL,  
MySQL, and SQLite now enjoy almost full support, though not  
everything works the same as using the native adapter. Depending on  
what you are doing, it may make sense to use postgres-pr on JRuby  
instead of PostgreSQL-JDBC.

To use the new JDBC support, the database connection string you give  
Sequel is now passed directly to JDBC, here are a few examples:

Sequel.connect(‘jdbc:postgresql://host/database?user=_&password=_’)  
Sequel.connect(‘jdbc:mysql://host/database?user=_&password=_’)  
Sequel.connect(‘jdbc:sqlite::memory:’)  
Sequel.connect(‘jdbc:sqlite:relative/path.db’)  
Sequel.connect(‘jdbc:sqlite:/absolute/path.db’)

## Single Gem

Sequel is now distributed as a single gem named sequel, by combining  
the previous sequel\_core and sequel gems. You can still just  
“require ‘sequel\_core’” if you don’t want the model functionality.

## Database Adapter Improvements

- Dataset#empty? now works using the MySQL adapter.

- The Oracle adapter now works with a nonstandard database port.

- The JDBC adapter should load JDBC drivers automatically for  
PostgreSQL, MySQL, SQLite, Oracle, and MSSQL. For PostgreSQL,  
MySQL, and SQLite, the jdbc-\* gem can be used, for the others, you  
must have the correct .jar in your CLASSPATH.

- The PostgreSQL adapter no longer raises an error when inserting  
records into a table without a primary key.

- Database#disconnect now works for the ADO adapter.

- The ADO adapter no longer raises an error if the dataset contains  
no records.

- The ODBC adapter no longer errors when converting ::ODBC::Time  
values.

## Backwards Incompatible Changes

- Sequel::Worker has been removed. There are no known users, and the  
specs caused problems on JRuby.

- Assigning an empty string to a non-string, non-blob model attribute  
converts it to nil by default. You can use  
“Model.typecast\_empty\_string\_to\_nil = false” to get the old  
behavior. This should make web development with Sequel  
significantly easier, hopefully at no expense to other uses.

- Database.uri\_to\_options is now a private class method.

- Model.create\_table! now acts the same as Database.create\_table!,  
dropping the table unconditionally and then creating it. This was  
done for consistency. If you are using Model.create\_table! in  
production code, you should change it to  
“Model.create\_table unless Model.table\_exists?”, otherwise you risk  
wiping out your production data. I recommended you use the  
migration feature instead of Model.set\_schema, as that handles  
altering existing tables.

## Other Notable Changes

- Using validates\_length\_of more than once on the same attribute with  
different options without a tag no longer causes the first use to  
be ignored. This was a side effect of the validation tags added  
in 2.2.0.

- Other than the adapters, Sequel now has 100% code coverage (line  
coverage).

- Model#set\* methods now return self.

- An integration test suite was added, testing Sequel against a live  
database with nothing mocked, which helped greatly when testing the  
new support for JDBC adapters.

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

Thanks,  
Jeremy

- {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](http://sequel.rubyforge.org)]

---

<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 26, 2008, 9:49am UTC](https://www.ruby-forum.com/t/ann-sequel-2-3-0-released/144172/2 "2008-07-26T09:49:04Z")

</div>

Jeremy E. wrote:

> To use the new JDBC support, the database connection string you give  
> Sequel is now passed directly to JDBC, here are a few examples:
> 
> Sequel.connect(‘jdbc:postgresql://host/database?user=_&password=_’)  
> Sequel.connect(‘jdbc:mysql://host/database?user=_&password=_’)  
> Sequel.connect(‘jdbc:sqlite::memory:’)  
> Sequel.connect(‘jdbc:sqlite:relative/path.db’)  
> Sequel.connect(‘jdbc:sqlite:/absolute/path.db’)

Very, very cool.

Thanks for the great work!

–  
James B.

[www.happycamperstudios.com](http://www.happycamperstudios.com) - Wicked Cool Coding  
[www.jamesbritt.com](http://www.jamesbritt.com) - Playing with Better Toys  
[www.ruby-doc.org](http://www.ruby-doc.org) - Ruby Help & Documentation  
[www.rubystuff.com](http://www.rubystuff.com) - The Ruby Store for Ruby Stuff
