# ANN: Sequel 0.4.5 Released

**URL:** <https://www.ruby-forum.com/t/ann-sequel-0-4-5-released/124139>\
**Category:** Ruby\
**Created:** [December 25, 2007, 8:38am UTC](https://www.ruby-forum.com/t/ann-sequel-0-4-5-released/124139 "2007-12-25T08:38:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ciconia](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/71c47a/32.png) [@ciconia](https://www.ruby-forum.com/u/ciconia)\
**Post date:** [December 25, 2007, 8:38am UTC](https://www.ruby-forum.com/t/ann-sequel-0-4-5-released/124139/1 "2007-12-25T08:38:07Z")

</div>

Sequel version 0.4.5 has just been released. Sequel is a lightweight  
database access and ORM library for Ruby. Sequel provides thread  
safety, connection pooling and a simple and expressive API for  
constructing database queries and table schemas.

This release includes new model validations and a few minor bug fixes  
and improvements. Here are the changes:

=== New model validations

Sequel now includes support for validations in models. The validations  
functionality is based on the Validatable gem (http://  
[validatable.rubyforge.org](http://validatable.rubyforge.org)), which needs to be installed if validations  
are to be used. Validations can be defined in two forms. First there  
is the validates method, which takes a block:

class User \< Sequel::Model(:users)  
validates do  
format\_of :email, :with =\> /somewhackyregexp/  
presence\_of :name  
…  
end  
end

You can also invoke all the validate\_xxx methods supported by  
validatable directly:

class User \< Sequel::Model(:users)  
validates\_format\_of :email, :with =\> /somewhackyregexp/  
validates\_presence\_of :name  
end

To check if an instance is valid you can call the #valid? method:

user.valid?

To check if a model class has defined validations you can invoke  
has\_validations?:

User.has\_validations?

=== Other changes

- Fixed update\_sql with array sub-item keys (#110).
- Added Model#update as alias to #set.
- Added Database#set\_column\_default method (thanks Jim M…)
- Added rdoc for new alter\_table functionality (#109).
- Refactored model specs.
- Removed warning on uninitialized @transform value (thanks Jim  
Morris).

=== More info

Sequel project page:  
[http://code.google.com/p/ruby-sequel](http://code.google.com/p/ruby-sequel)

Sequel documentation:  
[http://sequel.rubyforge.org](http://sequel.rubyforge.org)

Join the Sequel-talk group:  
[http://groups.google.com/group/sequel-talk](http://groups.google.com/group/sequel-talk)

Install the gem:  
sudo gem install sequel

Or check out the source and install manually:  
svn co [http://ruby-sequel.googlecode.com/svn/trunk](http://ruby-sequel.googlecode.com/svn/trunk) sequel  
cd sequel  
rake install
