This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Paolo Dona (author)
Thu Oct 16 01:22:38 -0700 2008
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Tue Aug 19 08:35:35 -0700 2008 | |
| |
MIT-LICENSE | Tue Aug 19 08:33:21 -0700 2008 | |
| |
README | Wed Oct 15 12:26:57 -0700 2008 | |
| |
Rakefile | Tue Aug 19 08:33:21 -0700 2008 | |
| |
init.rb | Tue Aug 19 08:33:21 -0700 2008 | |
| |
install.rb | Tue Aug 19 08:33:21 -0700 2008 | |
| |
lib/ | Thu Oct 16 01:22:38 -0700 2008 | |
| |
test/ | Wed Oct 15 10:57:50 -0700 2008 | |
| |
uninstall.rb | Tue Aug 19 08:33:21 -0700 2008 |
README
ImportWithLoadDataInFile ======================== This plugin allows you to bulk import records into a table using mysql's 'LOAD DATA INFILE' feature. It is very similar to ar-extensions import feature, but it seems to be about 30% faster. all it does is: - take a list of columns and a 2D Array with the column values - create a tempfile and put a csv representation of the data in it - call mysql's LOAD DATA INFILE against the temp file Example ======= # Table name: users # # id :integer(11) not null, primary key # name :string(20) # surname :string(32) # class User < ActiveRecord::Base # you need to include this module include ImportWithLoadDataInFile end cols = [:name, :surname] vals = [["paolo", "dona"], ["james", "dean"]] User.import_with_load_data_infile(cols, vals) # this generates a LOAD DATA LOCAL INFILE statement # if your db is on the same machine of the app server, you can switch off the LOCAL flag User.import_with_load_data_infile(cols, vals, :local => false) # this generates LOAD DATA INFILE







