Giter Site home page Giter Site logo

brkane / adapter_extensions Goto Github PK

View Code? Open in Web Editor NEW

This project forked from activewarehouse/adapter_extensions

0.0 2.0 0.0 152 KB

Adapter extensions for ActiveRecord

Home Page: http://activewarehouse.rubyforge.org/adapter_extensions/

License: MIT License

Ruby 99.24% Logos 0.76%

adapter_extensions's Introduction

AdapterExtensions add extra abilities to Rails ActiveRecord adapters, including:

  • bulk load
  • truncate table
  • copy table
  • add select into table

Compatibility matrix

See Travis for up-to-date info: Build Status

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

Important notes on MySQL support

Security warning

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

v0.9.5 will always use LOAD DATA LOCAL INFILE for bulk load - this is not configurable.

v1.0.0.rc1

This version should by default use LOAD DATA INFILE for safer defaults.

You can override this by passing :local_infile => true though.

Troubleshooting LOCAL INFILE

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:

For mysql2 with AR < 3.1:

  • no current easy solution afaik

For mysql:

Notes on SQLServer support

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.

Running the tests

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

License

MIT

Contributors

  • 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

adapter_extensions's People

Contributors

thbar avatar mainej avatar aeden avatar kookster avatar darinwilson avatar jlecour avatar

Watchers

James Cloos avatar Brian Kane avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.