Preface

Table of Contents

History
Design Goals
About This Guide

Ruby9i is a Ruby library that provides access to Oracle9i using the Oracle Call Interface. The Ruby9i core is a C extension that implements the basic functionality with calls to OCI functions. On top of this is a DBI-compliant API. Users of the library may choose to work with either API.

History

After being laid off in mid-June, I took a look at Ruby for the first time. My first impression was, “Wow! This is the language I would’ve written.” I wanted to learn more about it, and since I had a lot of time on my hands, I decided to write a Ruby interface to Oracle9i. I had already done something similar in C++ a couple years back, and it was a great learning experience. So, the day after reading Ruby’s documentation for the first time, I dove right in.

Design Goals

Aside from the goal of learning Ruby, I wanted the ability to use all of the latest features of Oracle and to access a reasonable subset of the functionality provided by the OCI. This includes the following:

  • The three TIMESTAMP types
  • The two INTERVAL types
  • User-defined types (named types)
  • Collections (VARRAYs and nested tables), including multi-level collections
  • Object REFs, object navigation and complex object retrieval
  • LOBs
  • Date functions and date/time arithmetic

About This Guide

This guide was written in XML using a derivative of the DocBook DTD that has some minor additions to accommodate the unique requirements of Ruby syntax. I also have a customized XSL stylesheet used to generate HTML. Both the custom DTD and XSL are still under development and do not yet support all of the Ruby syntax requirements.

In particular, the customizations still lack support for passing blocks to methods. As a result, the Ruby9i methods which can take blocks are not yet indicated as such. The best way to find these is to examine the C source code and look for the calls to rb_yield. I believe they are Statement#prepare, #execute and #fetch, and the corresponding methods of Database.

As you may have guessed by now, this guide is still under active development. It currently contains only reference material but will soon have introductory material and examples.

The version numbers of this document use the following pattern. The first three numbers correspond to the version of Ruby9i for which this document was written. The fourth and fifth numbers are the major and minor release numbers of this document, respectively.