# ANN: Sequel 0.1.6 Released

**URL:** <https://www.ruby-forum.com/t/ann-sequel-0-1-6-released/105707>\
**Category:** Ruby\
**Created:** [June 1, 2007, 4:46pm UTC](https://www.ruby-forum.com/t/ann-sequel-0-1-6-released/105707 "2007-06-01T16:46:22Z")\
**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:** [June 1, 2007, 4:46pm UTC](https://www.ruby-forum.com/t/ann-sequel-0-1-6-released/105707/1 "2007-06-01T16:46:22Z")

</div>

Sequel version 0.1.6 has just been released. New in this release is  
support for literal expressions, Dataset#or and Dataset#and, and the  
default join type is INNER JOIN. Various bug fixes courtesy of snok.

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

# Literal expressions

You can now use literal expressions in filters or update values:

items.update\_sql(:col2 =\> ‘col1 + 10’.expr) #=\>  
“UPDATE items SET col2 = col1 + 10”

items.exclude {col1 \> ‘col2 + col3’.expr}.sql #=\>  
“SELECT \* FROM items WHERE NOT (col1 \> col2 + col3)”

# Dataset#or, #and

Pretty much self-explanatory:

items.filter {col1 \> 100}.or(:col2 =\> nil).sql #=\>  
“SELECT \* FROM items WHERE (col1 \> 100) OR (col2 IS NULL)”

items.filter {col1 \> 100}.and(:col2 =\> nil).sql #=\>  
“SELECT \* FROM items WHERE (col1 \> 100) AND (col2 IS NULL)”

# Default join type

On advice from a dude named snok, I changed the default join type to  
INNER, since that’s what the SQL specs say. So now:

DB[:a].join(:b, :a\_id).sql #=\>  
“SELECT \* FROM a INNER JOIN b ON (b.a\_id = a.id)”

# SQLite Memory DB

The SQLite adapter always had support for memory DB’s:

Sequel.open ‘sqlite:/:memory:’

Well, now it’s even easier. Just omit the db name altogether:

Sequel.open ‘sqlite:/’

# Miscelenea

- Removed stub class methods from Model. Model.method\_missing now  
automagically creates stub methods as needed. This is the first step  
on the way to turning the model class into a supercharged dataset, but  
that’s a topic for a separate post. Coming soon… 🙂

- Fixed PrettyTable code so now model datasets can be printed just  
like naked datasets (thanks snok).

- Fixed Model#method\_missing to raise if an unknown attribute is  
accessed. Up until now this was the cause for a lot of potential  
hidden errors, as unintended method calls would be swallowed and  
ignored.

- Fixed ODBC timestamp conversion to support dates before 1970 and  
after 2040 (thanks snok.)

======================

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
