Extending Rails' ActiveRecord Adapters
Adapter Extensions provided extended capabilities for the database adapters in the Ruby on Rails ActiveRecord component. Currently the following adapters are supported:
- SQL Server
Here’s how to get rolling:
There are several ways to get the Adapter Extensions:
- Install the Gem
- Get to your command line and type
sudo gem install adapter_extensionson Linux or OS X or type
gem install adapter_extensionson Windows. AdapterExtensions depends on ActiveRecord, ActiveSupport and FasterCSV. If necessary you may have to approve the installation of these dependencies if they are not already installed.
- You can also download the packages in Zip, Gzip, or Gem format from the ActiveWarehouse files section on RubyForge.
- For the latest edge code:
git clone git://github.com/aeden/adapter_extensions.git.
Once you've installed the gem you can add the following lines to any Ruby script to use the adapter extensions:
require 'rubygems' require 'adapter_extensions'
What's There Now?
Right now the library does the following:
- Adds bulk_load method which uses the database's native bulk loading tool to load the flat file data
- Adds a truncate method to the abstract adapter
- Implemented for: MySQL, PostgreSQL and SQL Server
- Unit tests included