# Ruby/Informix 0.7.0

**URL:** <https://www.ruby-forum.com/t/ruby-informix-0-7-0/133514>\
**Category:** Ruby\
**Created:** [April 1, 2008, 7:17am UTC](https://www.ruby-forum.com/t/ruby-informix-0-7-0/133514 "2008-04-01T07:17:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gerardo\_SSGSSS\_mez](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/c37758/32.png) [@Gerardo\_SSGSSS\_mez](https://www.ruby-forum.com/u/Gerardo_SSGSSS_mez)\
**Post date:** [April 1, 2008, 7:17am UTC](https://www.ruby-forum.com/t/ruby-informix-0-7-0/133514/1 "2008-04-01T07:17:13Z")

</div>

I’m pleased to announce another release of Ruby/Informix, a Ruby  
library for connecting to IBM Informix.

In this release you’ll find support for the INTERVAL data type, more  
handy methods and more and better documentation with examples, along  
with a new web site.

Web site: [http://ruby-informix.rubyforge.org/](http://ruby-informix.rubyforge.org/)  
Documentation: [http://ruby-informix.rubyforge.org/doc/](http://ruby-informix.rubyforge.org/doc/)

Some examples:

Connecting to a database:

```
db = Informix.connect('stores')

```

Inserting records

```
stmt = db.prepare('insert into state values(?, ?)')
stmt.execute('CA', 'California')

```

Iterating over a table using a hash (shortcut):

```
db.each_hash('select * from customers') do |cust|
  puts "#{cust['firstname']} #{cust['lastname']}"
end

```

Changelog follows:

## 0.7.0 03/31/2008

New features:  
\* Experimental support for the INTERVAL data type:  
- year\_to\_month, day\_to\_fraction, from\_months and from\_seconds  
class  
methods for creating an Interval object  
- +@ and -@ unary operators  
- +, \* and / operations available with Integer, Rational, Date,  
Time  
and DateTime objects  
- methods for returning the respective fields of an Interval  
object  
individually (years, months, days, hours, minutes and seconds)  
- to\_a method for returning the fields of an Interval object as  
an array  
- methods for converting the Interval object to the given unit,  
where  
apply (to\_years, to\_months, to\_days, to\_hours, to\_minutes and  
to\_seconds)  
- to\_s method for displaying an Interval object as an string  
according  
to ANSI SQL standards  
- includes Comparable  
\* Database#version returns a struct with version information of the  
database  
server.  
\* Database#each and Database#each\_hash shortcut methods for  
declaring and  
opening a cursor in a single step.  
Contributed by Reid Morrison

```
* Database#execute is not an alias for Database#immediate any more.
  It has become a shortcut for preparing and executing a statement 

```

in a  
single step.  
\* SequentialCursor includes Enumerable  
\* Ruby 1.9 compatible  
\* More and better documentation

Bugs fixed:  
\* The documentation for class Error was not being recognized by rdoc

Remarks:  
\* Database.new deprecated in favor of Database.open  
\* Database#do was removed  
\* A lot of C code has been reimplemented in Ruby  
\* Modules and classes have been reorganized  
\* Database#execute still behaves the same, except that it can also  
accept  
input parameters and return at most one record. Database#immediate  
is  
more efficient though.

---

<div class="post-metadata">

**Author:** ![Gerardo\_SSGSSS\_mez](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/c37758/32.png) [@Gerardo\_SSGSSS\_mez](https://www.ruby-forum.com/u/Gerardo_SSGSSS_mez)\
**Post date:** [April 1, 2008, 9:10am UTC](https://www.ruby-forum.com/t/ruby-informix-0-7-0/133514/2 "2008-04-01T09:10:45Z")

</div>

Thanks for the information,  
Venu 9955

On Apr 1, 10:16 am, Gerardo S. Gómez Garrido
