# \[ANN\] Sequel 1.4.0

**URL:** <https://www.ruby-forum.com/t/ann-sequel-1-4-0/134231>\
**Category:** Ruby\
**Created:** [April 9, 2008, 5:30am UTC](https://www.ruby-forum.com/t/ann-sequel-1-4-0/134231 "2008-04-09T05:30:20Z")\
**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:** [April 9, 2008, 5:30am UTC](https://www.ruby-forum.com/t/ann-sequel-1-4-0/134231/1 "2008-04-09T05:30:20Z")

</div>

Sequel is a database access toolkit for Ruby. Sequel provides thread  
safety, connection pooling, and a concise DSL for constructing queries  
and table schemas.

Sequel makes it easy to deal with multiple records without having to  
break your teeth on SQL.

Sequel 1.4.0 has been released and should be avaiable on the gem mirrors  
shortly. 1.4.0 has the following exciting new features:

Eager loading for all types of associations:

Artist.eager(:albums).all  
Album.eager(:artist, :genre, :tracks).all  
Album.eager(:artist).eager(:genre).eager(:tracks).all  
Album.filter(:year=\>2008).eager(:artist).all

Eager loading supports cascading to an unlimited depth, and doesn’t have  
any aliasing issues:

Artist.eager(:albums=\>:tracks).all  
Artist.eager(:albums=\>{:tracks=\>:genre}).all

Unfortunately, eager loading comes at the expense of a small amount of  
backward compatibility. If you were using uncached associations (the  
default in sequel\_model 0.5), they no longer work the same way. Now,  
all associations act as if :cache=\>true (which is now set for all  
associations, so if you wrote a tool that worked with both cached and  
uncached associations, it should still work).

One to many associations now populate the corresponding many to one  
instance variable (even when eagerly loaded):

# Assuming: Album.one\_to\_many :tracks

album = Album.first

# This following code is only one query,

# not a query for the album and one for each track

album.tracks.each{|t| puts t.album.name}

ActiveRecord style has\_many :through associations are now supported via  
many\_to\_many. many\_to\_many will no longer select the entire result set,  
just the columns of the associated table (and not the join table), so it  
works for both has\_and\_belongs\_to\_many (simple join table) and has\_many  
:through (join table model) scenarios. If you want to include all or  
part of the join table attributes, see the :select option for  
many\_to\_many associations.

We reduced the number of gems from three (sequel, sequel\_core,  
sequel\_model) to two (sequel, sequel\_core). Basically, sequel\_model is  
now just sequel, and the old sequel gem metapackage is no longer. There  
isn’t a reason to have a gem metapackage for two gems when one  
(sequel\_model) depends on the other (sequel\_core). This required a  
version bump for the model part of sequel from 0.5.0.2 to 1.4.0 (since  
the previous sequel gem version was 1.3).

Sequel 1.4.0 has fixes for 11 trackers issues, including fixes to the  
MySQL and PostgreSQL adapters.

We have switched the source control repository for Sequel from Google  
Code (which uses subversion) to github (which uses git). If you would  
like to contribute to Sequel, please fork the github repository, make  
your changes, and send a pull request. As before, posting patches on  
the Google Code issue tracker is fine as well.

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

Thanks,  
Jeremy

- {Project page}[[Google Code Archive - Long-term storage for Google Code Project Hosting.](http://code.google.com/p/ruby-sequel/)]
- {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)]
- {RubyForge page}[[http://rubyforge.org/projects/sequel/](http://rubyforge.org/projects/sequel/)]
- {API RDoc}[[http://sequel.rubyforge.org](http://sequel.rubyforge.org)]
