Zach Dennis
a4f17e6d45
Merge remote-tracking branch 'chewi/scope-awareness'
2012-12-14 09:40:03 -05:00
mildmojo
43bd628e05
Fixes case-sensitive SQLite3 adapter name typos.
...
The SQLite3 adapter name was referenced as
`ActiveRecord::ConnectionAdapters::Sqlite3Adapter`, but the
ActiveRecord class is spelled `SQLite3Adapter` (upper-case "SQL"). As
a result, `active_record/adapters/sqlite3_adapter.rb` wasn't actually
including the methods from `adapters/sqlite3_adapter.rb` into the AR
adapter class.
This adds a test for proper inheritance and fixes the spelling of
`SQLite3Adapter`, unifying all references to the ActiveRecord version.
2012-10-01 03:08:07 -04:00
James Le Cuirot
22473145d1
Add scope-awareness feature
2012-09-20 15:15:21 +01:00
Zach Dennis
6182b944ef
Merge pull request #56 from grzuy/support_all_or_none_records
...
Adds support for :all_or_none option on #import
2012-08-29 20:48:18 -07:00
Yury Velikanau
1d9b30cf83
Put together tests for seamless_database_pool adapter
2012-08-22 19:50:37 -07:00
Ben Pickles
f12d72b0b1
Raise a useful message when a value doesn't have a corresponding column.
2012-08-19 19:41:02 +01:00
Zach Dennis
a1a183e43d
Updating Gemfile to latest versions of libraries:
...
* updating deprecated require 'rake/rdoctask' with 'rdoc/task'
* preparing to remove deprecated ActiveRecord set_table_name with self.table_name=
2012-08-06 09:24:34 -04:00
Zach Dennis
b500ebe5a1
Updating tests around working with non-standard ActiveRecord models with non-sequence based primary keys.
...
* move into test/import_test so it runs across all supported adapters
[#60 ]
2012-08-06 09:23:01 -04:00
Jared Luxenberg
e12f9c4951
Model#import fails to find model's primary key sequence
...
Fixes a bug where Model#import does not work when a model's primary key
has no associated 'sequence' in the database. If a value for the primary
key is specified, then the insert should not require a database
'sequence' to generate a value for that primary key field.
2012-08-04 17:35:50 -07:00
Gonzalo Rodriguez
eac7d5f949
Adds support for :all_or_none option on #import
2012-05-19 17:40:04 -03:00
Ben Woosley
8d20594f12
Replace #sum_sizes with calls to ActiveSupport #sum, as splatting large numbers of values is resource intensive andcan cause stack overflows of the sort 'SystemStackError: stack level too deep'
2011-08-16 17:01:11 -07:00
Zach Dennis
5a71efa2b4
Merge pull request #21 from jamiecobbett/master
...
Fix import of very large datasets containing multibyte chars on Ruby 1.9
2011-06-22 19:51:29 -07:00
Jamie Cobbett
6555fd70ba
Correctly obey MySQL MAX PACKET
...
Use String's bytesize instead of size, because we're talking about byte length,
not string length. This resolves a problem on Ruby 1.9 with multi-byte
characters.
2011-05-08 21:35:47 +00:00
Jason
88e2ee034b
Adding jdbcmysql support.
2011-05-04 20:27:11 -04:00
Zach Dennis
5b3740e0f2
Updating import_test to be Ruby 1.9.2 compatible. Ruby 1.9.1 changed the Date.parse capabilities to no longer support MM/DD/YYYY functionality so we only test against YYYY/MM/DD.
...
[fixes https://github.com/zdennis/activerecord-import/issues/19 ]
2011-05-04 19:55:46 -04:00
Zach Dennis
7958ed18c2
Added :synchronize_keys to the import options so importing can synchronize on fields beside the primary key.
...
https://github.com/zdennis/activerecord-import/issues/16
2011-04-06 14:20:53 -04:00
Zach Dennis
e00e9d7d59
Adding in support for :synchronization option for #import. Pulled in from ar-extensions. Currently only works with MySQL since that is the only database that supports on duplicate key update functionality.
...
https://github.com/zdennis/activerecord-import/issues#issue/6
2011-03-19 15:49:26 -04:00
Zach Dennis
319c52d80f
Pulled in ActiveRecord synchronize functionality from the old ar-extensions code base.
...
https://github.com/zdennis/activerecord-import/issues#issue/6
2011-03-19 15:38:24 -04:00
Zach Dennis
32a2fe3bce
Adding a test to ensure that specified ids are being saved when imported.
...
https://github.com/zdennis/activerecord-import/issues#issue/4
2011-03-19 15:20:44 -04:00
Franck Verrot
d901a7c60f
Importing an empty array of objects/values should be supported
2011-03-19 15:11:28 -04:00
Zach Dennis
cb6b726eac
Ensure the #max_allowed_packet method exists for the MysqlAdapters.
...
https://github.com/zdennis/activerecord-import/issues#issue/12
2011-01-11 21:01:34 -05:00
Ben Woosley
a3e9b4f040
Enable ImportSupport on Postgresql - the test suite now passes in full
2011-01-10 22:27:23 -05:00
Ben Woosley
0bbc24ba38
Keep test/database.yml out of the project so others can keep their own around
2011-01-10 21:57:40 -05:00
Ben Woosley
b1c73ffac2
Update test/database.yml.sample from test/database.yml
2011-01-10 21:57:40 -05:00
Zach Dennis
8fbf841fde
Use ActiveRecord Column#type_cast to properly parse fields represented by a string.
...
Fixed issued reported by Nick Burdick where imported datetime fields was not correctly working with certain string formats for MySQL which doesn't support MM/DD/YYYY format directly.
2011-01-05 19:09:55 -05:00
Zach Dennis
6c9cbc096c
Updatin to not depend on Rails 3, only ActiveRecord, both in gem file and in tests
2010-10-05 22:38:18 -04:00
Zach Dennis
5fa9b93003
Updating MySQL import tests to load files in a ruby1.9 friendly way.
2010-09-26 22:10:12 -04:00
Zach Dennis
cb542a86f4
Updated how activerecord-import loads so it is done after a connection is established in ActiveRecord. This supports loading import for multiple adapters automatically w/o having to have a person require those specifically.
2010-09-26 20:48:14 -04:00
Zach Dennis
163f5c64be
Deprecating usage of "require 'activerecord-import/<adapter_name>'" in favor of "require 'activerecord-import'".
2010-09-26 17:07:41 -04:00
Zach Dennis
948dec0be2
Refactoring to allow for separation of activerecord-import code and activerecord's connection adapters.
2010-09-26 16:51:19 -04:00
Zach Dennis
b6c72f8456
Providing support for the Mysql2 adapter.
2010-09-26 16:04:00 -04:00
Victor Costan
42175ca94a
Initial work for re-packaging as gem.
2010-08-10 21:39:26 -04:00
Zach Dennis
24feb801f5
Updated how tests are run so Rake is not invoked twice.
...
* removing support for Oracle in the rakefile as it is no currently supported
2010-08-10 20:48:16 -04:00
Zach Dennis
e0dff4c055
Moved all adapter specific code into adapters/ directory and updated all adapters to utilize the same "require_adapter" method of loading specific-database adapters.
...
* Adds back in SQLite3 and PostgreSQL support
issue-url: http://github.com/zdennis/activerecord-import/issues#issue/1
[contributes #1 ]
2010-08-10 20:46:32 -04:00
Zach Dennis
4fcfa7fd14
Restructuring directories.
2010-06-26 15:43:34 -04:00
Zach Dennis
5c287f1042
Added back in basic benchmark support. To run:
...
ruby benchmark/benchmark.rb --adapter mysql --num 1000
ruby benchmark/benchmark.rb --adapter mysql --num 1000 --to-csv /tmp/results.csv
ruby benchmark/benchmark.rb --adapter mysql --num 1000 --to-html /tmp/results.html
2010-04-08 23:12:28 -04:00
Zach Dennis
3523138a7a
* Added basic import support for PostgreSQL.
...
* Requiring database adapter is now "require 'ar-extensions/import/<adapter_name>" so it won't conflict with previous versions of ar-extensions or other libraries extracted out of older ar-extensions, which "require 'ar-extensions'"
2010-04-08 20:57:10 -04:00
Zach Dennis
075104a944
Finished porting over MySQL import functionality.
...
* removed assertions on #num_inserts, that is db-specific and is handled in details by abstract_adapter_test.
2010-03-13 22:30:29 -05:00
Zach Dennis
e8271778b7
About 85% through porting over MySQL on duplicate key functionality.
2010-03-13 21:33:03 -05:00
Zach Dennis
459aeb6fee
Updated Rakefile and test_helper to work with more adapters than just sqlite3.
2010-03-13 20:20:55 -05:00
Zach Dennis
61c1af6520
Moving unnecessary puts statement.
2010-03-13 20:20:32 -05:00
Zach Dennis
7a3850a7c8
Fixed bug in generic import test.
2010-03-13 20:19:46 -05:00
Zach Dennis
5c5bd5f716
Implemented tests for #get_value_insert_sets.
2010-03-12 00:04:15 -05:00
Zach Dennis
db173ef907
Implementing the majority of generic #import tests.
2010-03-11 23:52:16 -05:00
Zach Dennis
ca5f83e1cf
Initial commit of making ar-extensions import Rails 3 friendly
2010-03-11 21:32:56 -05:00