# ANN: Sequel 0.4.3 Released

**URL:** <https://www.ruby-forum.com/t/ann-sequel-0-4-3-released/123236>\
**Category:** Ruby\
**Created:** [December 15, 2007, 8:30am UTC](https://www.ruby-forum.com/t/ann-sequel-0-4-3-released/123236 "2007-12-15T08:30:41Z")\
**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 15, 2007, 8:30am UTC](https://www.ruby-forum.com/t/ann-sequel-0-4-3-released/123236/1 "2007-12-15T08:30:41Z")

</div>

Sequel version 0.4.3 has just been released. This release includes  
numerous improvements and bug fixes. Here’s a list of the changes:

=== Database-related

- Added Database#add\_index method, letting you add indexes without  
having to create a schema:

- Added support for inline index definition. Instead of adding an  
index statement for each column you want to create, you can just add  
an index option:

- Added Database#create\_table! method for forcibly creating a table.  
This method will drop the table (if it exists) before creating it  
again.

- Added Database#create\_view, #create\_or\_replace\_view and #drop\_view  
methods. You can supply either a dataset or an SQL as the source for  
the view. For example:

Also implemented are Dataset#create\_view and #create\_or\_replace\_view  
convenience methods.

DB[:items].where(:active =\> true).create\_view(:active\_items)

=== Dataset-related

- Dataset#update can now accept blocks or plain strings. You can now  
supply a custom string with assignment expressions:

You can also now supply a block to update:

DB[:items].update do  
:x \<\< 1  
:y \<\< 2  
end  
#=\> “UPDATE items SET x = 1, y = 2”

This is very useful if you need to do stuff like incrementing a  
counter column or using a custom SQL expression:

DB[:items].update {:count \<\< :count + 1}  
#=\> “UPDATE items SET count = count + 1”

DB[:items].update {:featured \<\< :price \< 100}  
#=\> “UPDATE items SET featured = price \< 100”

- Added support for subscript access using Symbol#| operator. If you  
use array types in your tables you now have an easy way of accessing  
array items:

> 0)"

You can also access items in multi-dimensional arrays:

DB[:items].where {:bits|1|2|3 \> 0}.sql  
#=\> “SELECT \* FROM items WHERE (bits[1, 2, 3] \> 0)”

=== Model-related

- Added Model.create\_with\_params method that filters the given  
parameters accordring to the model’s columns (thanks Aman G.). This  
method was added by to request from users of Merb and Ramaze that  
wanted a simple way to create a model instance from request  
parameters. The method filters out any parameters that do not have  
corresponding columns in the underlying dataset.

=== Miscellaneous

- Fixed Model.[] to raise for boolean argument (#97).

- Added error reporting for filtering on comparison not in a block  
(thanks Jim M.).

- Fixed Dataset#count to work properly with datasets with fixed SQL  
(when using #fetch).

- Refactored and fixed Dataset#reverse\_order to work with field  
quoting (thanks Christian).

- Fixed problem with field quoting in insert statements.

- Changed sequelizer code to silently fail on any error when requiring  
parsetree and ruby2ruby.

- Keep DRY by re-using Model#[]= from method\_missing.

- Added Model.fetch alias for DB.fetch.set\_model(Model).

=== 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
