# ANN: Sequel 0.1.9.7 Released

**URL:** <https://www.ruby-forum.com/t/ann-sequel-0-1-9-7-released/112115>\
**Category:** Ruby\
**Created:** [August 15, 2007, 4:21pm UTC](https://www.ruby-forum.com/t/ann-sequel-0-1-9-7-released/112115 "2007-08-15T16:21:40Z")\
**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:** [August 15, 2007, 4:21pm UTC](https://www.ruby-forum.com/t/ann-sequel-0-1-9-7-released/112115/1 "2007-08-15T16:21:40Z")

</div>

Sequel version 0.1.9.7 has just been released. This release includes a  
number of big fixes, as well as convenience methods for opening  
databases and a new method for batch inserting records. Following is a  
discussion of the main changes:

# New Dataset#multi\_insert for batch inserting records

The new Dataset#multi\_insert method lets you process batch insertions  
with ease. The records are supplied to the method as an array of  
hashes, and the inserts are wrapped in a transaction. Here’s an  
example:

DB[:items].multi\_insert(records)

You can also specify a :commit\_every option that causes the method to  
split the records array into batches that will be inserted using  
separate transactions:

DB[:items].multi\_insert(records, :commit\_every =\> 1000)

Using the :commit\_every option when inserting a large amount of  
records can greatly improve performance and is highly recommended.

(Thanks to Victor “Zverok” Shepelev for suggesting this feature.)

# Convenience Methods for Opening Databases

The solution for opening DBI databases has now been generalized, with  
each adapter having its own convenience method, so you don’t need to  
use URI’s anymore:

# open a memory SQLite database

DB = Sequel.sqlite

# open a regular SQLite database

DB = Sequel.sqlite(‘test.db’)

# open a postgres database

DB = Sequel.postgres(‘mydb’)

# open a postgres database with options

DB = Sequel.postgres(‘mydb’, :user =\> ‘myuser’)

# Bug Fixes and Miscellanea

- Added support for executing batch statements in the sqlite adapter.

- Changed #current\_page\_record\_range to return 0…0 for an invalid  
page.

- Aliased tables are now joined properly, e.g.: DB[‘stats  
s’].join(‘player p’, :id =\> :player\_id)

- Improved Symbol#to\_field\_name to prevent false positives. Since  
symbols are also used to signify SQL literals, this could help in some  
cases where they were converted to dot notation by mistake.

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

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
