Commit graph

13 commits

Author SHA1 Message Date
Seamus Abshere b36259af29 Solving #50 - memoize MySQL's max_allowed_packet instead of querying it every time you run .import 2012-03-20 16:40:10 -05:00
Zach Dennis b2c71336ca Merge pull request #20 from Empact/drop_sum_sizes
Rely on ActiveSupport #sum rather than #sum_sizes
2012-01-06 15:47:53 -08:00
Yehuda Katz b5261d0225 Clean up module usage. There's no need to use InstanceMethods -- normal Ruby modules and includes will work fine here. 2012-01-03 00:41:04 -08: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
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
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
Zach Dennis 161cf017f9 Renamed #values_sql_for_column_names_and_attributes to #values_sql_for_columns_and_attributes and cleaned up how it dealt with columns.
* added back in the support for type-casting based on the database column
* removed unused method in ActiveRecord::Import::AbstractAdapter

https://github.com/zdennis/activerecord-import/issues#issue/5
2011-01-10 22:36:52 -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 6b2153a841 Simplify values_sql_for_column_names_and_attributes with #map 2011-01-10 22:11:51 -05:00
Ben Woosley 7aefcf1164 Inline multiple_value_sets_insert_sql because it never changes, isn't particularly well-factored, and for parity with "not supports_import?" 2011-01-10 21:57:41 -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 90057c43eb Renaming ActiveRecord::Extensions to ActiveRecord::Import. 2010-09-26 17:05:02 -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