Sunday, December 17, 2006

Ruby/Informix 0.4.0 released

Ruby/Informix is almost full-featured and closer to 1.0.0. Don't hesitate to e-mail me if you have any suggestion, comment, criticism, feature request, bug report or question.

In this release there are two new major features added: multiple connections to databases and scroll cursors.

The interface to scroll cursors provided by Ruby/Informix resembles that of Array objects for accessing elements. Besides prev, next, first, last and current for traversing a scroll cursor, it counts with [] and slice methods that let you access a scroll cursor as an Array:



customers = db.cursor('select * from customers', :scroll=>true)
customers.open
customers[0] # => same as customers.first
customers[-1] # => same as customers.last
customers[2, 5] # => retrieves 5 records starting from the 3rd record
customers.drop


Just like Ruby Arrays, negative values for indices mean an offset from the end of the Array, being -1 the last element. Similarly, when using the [start, length] syntax, it retrieves an array of at most length elements starting from start. More details in the documentation.

Starting from this release, a Ruby gem will be provided for easily downloading, building and installing Ruby/Informix. Just type



gem install ruby-informix


from a command prompt on any platform supported.

Expect more exciting things to come for Ruby/Informix.



And just after releasing 0.4.0, there are news from IBM for officially supporting Ruby, according to Jerry Keesee, Director of the Informix Lab (read complete note here.) But this support won't be available until mid-2007.