During choosing database for our new project, we have found Intersystems Caché database.
We’re using Ruby on Rails for development, but it has no driver for ODBC and no driver for Caché. Problem. Problems are made to be solved.

Caché has at least three interfaces for communication:

* SQL interface * Object interface * callin interface

The last one isn’t easy to work with, thus I haven’t looked at it at all. So, I’ve decided to implement second variant: object interface. Here is an example of code, that is already working

require ‘cache-ruby’ class Article < Cache::Object database Cache::Database.new(:user => “Admin”, :password => “123”, :namespace => “User”) class_name “User.Article” end @a = Article.open(21) puts @a.name @a.name = “Anni Fyo” @a.save @a = Article.open(21) puts @a.name puts @a.id

Результат:

Nichols,Janice A. Anni Fyo 21

So, we have preliminary driver for working Ruby and Caché, but it is object interface. We haven’t implemented SQL interface, but it is a matter of time.

You can take code from svn repository. This code can work under Mac OS X. I don’t know, whether it works under other platforms.

Caché can be downloaded from their website.

Sidebar