AdapterExtensions add extra abilities to Rails ActiveRecord adapters, including:
- bulk load
- truncate table
- copy table
- add select into table
See Travis for up-to-date info:
| v1.0.0.rc1 | v0.9.5 | |
|---|---|---|
| ActiveRecord adapters | ||
| mysql | OK | OK |
| mysql2 | OK | Unsupported |
| postgresql | OK | OK |
| sqlserver | Work in progress | Broken |
| ActiveRecord/ActiveSupport versions | >= 3 | < 3 |
| Ruby versions | ||
| MRI 1.9.3 | OK | Untested |
| MRI 1.8.7 | OK | Should be OK |
Be sure to first read and understand the security implications of LOAD DATA LOCAL INFILE. In particular, having this enabled on a web app is probably not a good idea.
v0.9.5 will always use LOAD DATA LOCAL INFILE for bulk load - this is not configurable.
This version should by default use LOAD DATA INFILE for safer defaults.
You can override this by passing :local_infile => true though.
If you enable :local_infile => true and meet the following error, then you'll have to work it around.
The used command is not allowed with this MySQL version: LOAD DATA LOCAL INFILE
For mysql2 with AR >= 3.1:
- use this fork until this pull-request is merged
- add
local_infile: trueto your database.yml
For mysql2 with AR < 3.1:
- no current easy solution afaik
For mysql:
- try this untested patch
v0.9.5 had a broken support for SQLServer.
v1.0.0.rc1 has a work-in-progress bulk import using freebcp. More tweaking needed.
You may have to tweak the Rakefile and database.yml a bit, but roughly:
rake ci:create_db
rake "ci:run_one[mysql2,test/config/gemfiles/Gemfile.rails-3.2.x]"
You can also run a matrix of tests using:
rake ci:run_matrix
MIT
- Thibaut Barrère (current maintainer)
- original code by Anthony Eden and probably others (let me know if you read this!)
- thanks to Zach Dennis for his work where I borrowed ideas for the rails 3 rewrite
