ActiveRecord Mimer

This project is basically an ActiveRecord connector for the Mimer SQL database. It uses ODBC to communicate with the database, and supports most regular operations and migrations.

Dependencies

unixODBC 2.2.8 or later

A good installation instruction can be found
at http://developer.mimer.com/howto/howto_57.htm

Ruby-ODBC

http://www.ch-werner.de/rubyodbc/

Using ActiveRecord Mimer

Standalone, with ActiveRecord

Using this adapter is very simple, but requires that you manually add the adapter. So, to use it in a script, add this to the requires':

RAILS_CONNECTION_ADAPTERS = ['mimer']
require 'active_record'

After this you can establish a JDBC connection like this:

ActiveRecord::Base.establish_connection(
  :adapter => 'mimer',
  :dsn => 'yourODBCdsn',
  :username => 'username',
  :password => 'pwd'
)

If provided, password and username will be used. After the connection is established Active Record can be used as usual.

Inside Rails

Using the adapter inside Rails is slightly more complicated, since we don't have control over the load process. The easiest way to add Mimer support is to manually edit your environment.rb, and add this line:

require 'mimer_adapter'

between

require File.join(File.dirname(__FILE__), 'boot')

and

Rails::Initializer.run do |config|

The head of my environment.rb after these modifications look like this:

RAILS_GEM_VERSION = '1.1.6'

# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')

require 'mimer_adapter'

Rails::Initializer.run do |config|
  # Settings in config/environments/* take precedence those specified here

Authors

This project was written by: Fredrik Ă…lund and Ola Bini with some code from rails-odbc.

License

ActiveRecord-Mimer is released under an MIT license.