activerecord-import 1.0.4 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yaml +159 -0
- data/.gitignore +5 -0
- data/.rubocop.yml +76 -7
- data/.rubocop_todo.yml +10 -16
- data/Brewfile +3 -1
- data/CHANGELOG.md +143 -3
- data/Dockerfile +23 -0
- data/Gemfile +28 -24
- data/LICENSE +21 -56
- data/README.markdown +83 -27
- data/Rakefile +3 -0
- data/activerecord-import.gemspec +10 -5
- data/benchmarks/benchmark.rb +10 -6
- data/benchmarks/lib/base.rb +10 -5
- data/benchmarks/lib/cli_parser.rb +10 -6
- data/benchmarks/lib/float.rb +2 -0
- data/benchmarks/lib/mysql2_benchmark.rb +2 -0
- data/benchmarks/lib/output_to_csv.rb +2 -0
- data/benchmarks/lib/output_to_html.rb +4 -2
- data/benchmarks/models/test_innodb.rb +2 -0
- data/benchmarks/models/test_memory.rb +2 -0
- data/benchmarks/models/test_myisam.rb +2 -0
- data/benchmarks/schema/{mysql_schema.rb → mysql2_schema.rb} +2 -0
- data/docker-compose.yml +34 -0
- data/gemfiles/5.2.gemfile +2 -0
- data/gemfiles/6.0.gemfile +3 -0
- data/gemfiles/6.1.gemfile +4 -1
- data/gemfiles/7.0.gemfile +4 -0
- data/gemfiles/7.1.gemfile +3 -0
- data/gemfiles/7.2.gemfile +3 -0
- data/gemfiles/8.0.gemfile +3 -0
- data/lib/activerecord-import/active_record/adapters/abstract_adapter.rb +2 -0
- data/lib/activerecord-import/active_record/adapters/jdbcmysql_adapter.rb +6 -4
- data/lib/activerecord-import/active_record/adapters/jdbcpostgresql_adapter.rb +2 -0
- data/lib/activerecord-import/active_record/adapters/jdbcsqlite3_adapter.rb +2 -0
- data/lib/activerecord-import/active_record/adapters/mysql2_adapter.rb +2 -0
- data/lib/activerecord-import/active_record/adapters/postgresql_adapter.rb +2 -0
- data/lib/activerecord-import/active_record/adapters/seamless_database_pool_adapter.rb +2 -0
- data/lib/activerecord-import/active_record/adapters/sqlite3_adapter.rb +2 -0
- data/lib/activerecord-import/active_record/adapters/trilogy_adapter.rb +8 -0
- data/lib/activerecord-import/adapters/abstract_adapter.rb +9 -6
- data/lib/activerecord-import/adapters/em_mysql2_adapter.rb +2 -0
- data/lib/activerecord-import/adapters/mysql2_adapter.rb +2 -0
- data/lib/activerecord-import/adapters/mysql_adapter.rb +30 -21
- data/lib/activerecord-import/adapters/postgresql_adapter.rb +68 -48
- data/lib/activerecord-import/adapters/sqlite3_adapter.rb +37 -30
- data/lib/activerecord-import/adapters/trilogy_adapter.rb +7 -0
- data/lib/activerecord-import/base.rb +3 -1
- data/lib/activerecord-import/import.rb +160 -58
- data/lib/activerecord-import/synchronize.rb +3 -1
- data/lib/activerecord-import/value_sets_parser.rb +5 -0
- data/lib/activerecord-import/version.rb +3 -1
- data/lib/activerecord-import.rb +2 -1
- data/test/adapters/jdbcmysql.rb +2 -0
- data/test/adapters/jdbcpostgresql.rb +2 -0
- data/test/adapters/jdbcsqlite3.rb +2 -0
- data/test/adapters/makara_postgis.rb +2 -0
- data/test/adapters/mysql2.rb +2 -0
- data/test/adapters/mysql2_makara.rb +2 -0
- data/test/adapters/mysql2spatial.rb +2 -0
- data/test/adapters/postgis.rb +2 -0
- data/test/adapters/postgresql.rb +2 -0
- data/test/adapters/postgresql_makara.rb +2 -0
- data/test/adapters/seamless_database_pool.rb +2 -0
- data/test/adapters/spatialite.rb +2 -0
- data/test/adapters/sqlite3.rb +2 -0
- data/test/adapters/trilogy.rb +9 -0
- data/test/database.yml.sample +7 -0
- data/test/{travis → github}/database.yml +9 -3
- data/test/import_test.rb +108 -41
- data/test/jdbcmysql/import_test.rb +5 -3
- data/test/jdbcpostgresql/import_test.rb +4 -2
- data/test/jdbcsqlite3/import_test.rb +4 -2
- data/test/makara_postgis/import_test.rb +4 -2
- data/test/models/account.rb +2 -0
- data/test/models/alarm.rb +2 -0
- data/test/models/animal.rb +8 -0
- data/test/models/author.rb +9 -0
- data/test/models/bike_maker.rb +3 -0
- data/test/models/book.rb +12 -3
- data/test/models/car.rb +2 -0
- data/test/models/card.rb +5 -0
- data/test/models/chapter.rb +2 -0
- data/test/models/composite_book.rb +19 -0
- data/test/models/composite_chapter.rb +12 -0
- data/test/models/customer.rb +18 -0
- data/test/models/deck.rb +8 -0
- data/test/models/dictionary.rb +2 -0
- data/test/models/discount.rb +2 -0
- data/test/models/end_note.rb +2 -0
- data/test/models/group.rb +2 -0
- data/test/models/order.rb +17 -0
- data/test/models/playing_card.rb +4 -0
- data/test/models/promotion.rb +2 -0
- data/test/models/question.rb +2 -0
- data/test/models/rule.rb +2 -0
- data/test/models/tag.rb +9 -1
- data/test/models/tag_alias.rb +11 -0
- data/test/models/topic.rb +8 -0
- data/test/models/user.rb +2 -0
- data/test/models/user_token.rb +2 -0
- data/test/models/vendor.rb +2 -0
- data/test/models/widget.rb +12 -3
- data/test/mysql2/import_test.rb +5 -3
- data/test/mysql2_makara/import_test.rb +5 -3
- data/test/mysqlspatial2/import_test.rb +5 -3
- data/test/postgis/import_test.rb +4 -2
- data/test/postgresql/import_test.rb +4 -2
- data/test/schema/generic_schema.rb +37 -1
- data/test/schema/jdbcpostgresql_schema.rb +3 -1
- data/test/schema/mysql2_schema.rb +2 -0
- data/test/schema/postgis_schema.rb +3 -1
- data/test/schema/postgresql_schema.rb +38 -4
- data/test/schema/sqlite3_schema.rb +2 -0
- data/test/schema/version.rb +2 -0
- data/test/sqlite3/import_test.rb +4 -2
- data/test/support/active_support/test_case_extensions.rb +3 -5
- data/test/support/assertions.rb +2 -0
- data/test/support/factories.rb +2 -0
- data/test/support/generate.rb +4 -2
- data/test/support/mysql/import_examples.rb +7 -8
- data/test/support/postgresql/import_examples.rb +121 -53
- data/test/support/shared_examples/on_duplicate_key_ignore.rb +2 -0
- data/test/support/shared_examples/on_duplicate_key_update.rb +69 -10
- data/test/support/shared_examples/recursive_import.rb +137 -1
- data/test/support/sqlite3/import_examples.rb +2 -1
- data/test/synchronize_test.rb +2 -0
- data/test/test_helper.rb +38 -24
- data/test/trilogy/import_test.rb +7 -0
- data/test/value_sets_bytes_parser_test.rb +3 -1
- data/test/value_sets_records_parser_test.rb +3 -1
- metadata +46 -22
- data/.travis.yml +0 -74
- data/gemfiles/3.2.gemfile +0 -2
- data/gemfiles/4.0.gemfile +0 -2
- data/gemfiles/4.1.gemfile +0 -2
- data/gemfiles/4.2.gemfile +0 -2
- data/gemfiles/5.0.gemfile +0 -2
- data/gemfiles/5.1.gemfile +0 -2
- data/lib/activerecord-import/mysql2.rb +0 -7
- data/lib/activerecord-import/postgresql.rb +0 -7
- data/lib/activerecord-import/sqlite3.rb +0 -7
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
def should_support_recursive_import
|
2
4
|
describe "importing objects with associations" do
|
3
5
|
let(:new_topics) { Build(num_topics, :topic_with_book) }
|
@@ -138,6 +140,15 @@ def should_support_recursive_import
|
|
138
140
|
books.each do |book|
|
139
141
|
assert_equal book.topic_id, second_new_topic.id
|
140
142
|
end
|
143
|
+
|
144
|
+
books.each { |book| book.topic_id = nil }
|
145
|
+
assert_no_difference "Book.count", books.size do
|
146
|
+
Book.import books, validate: false, on_duplicate_key_update: [:topic_id]
|
147
|
+
end
|
148
|
+
|
149
|
+
books.each do |book|
|
150
|
+
assert_nil book.topic_id, nil
|
151
|
+
end
|
141
152
|
end
|
142
153
|
|
143
154
|
unless ENV["SKIP_COMPOSITE_PK"]
|
@@ -154,6 +165,24 @@ def should_support_recursive_import
|
|
154
165
|
assert_equal 1, tags[0].tag_id
|
155
166
|
assert_equal 2, tags[1].tag_id
|
156
167
|
end
|
168
|
+
|
169
|
+
if ENV['AR_VERSION'].to_f >= 7.1
|
170
|
+
it "should import models with auto-incrementing ID successfully with recursive set to true" do
|
171
|
+
author = Author.create!(name: "Foo Barson")
|
172
|
+
books = []
|
173
|
+
2.times do |i|
|
174
|
+
books << CompositeBook.new(author_id: author.id, title: "Book #{i}", composite_chapters: [
|
175
|
+
CompositeChapter.new(title: "Book #{i} composite chapter 1"),
|
176
|
+
CompositeChapter.new(title: "Book #{i} composite chapter 2"),
|
177
|
+
])
|
178
|
+
end
|
179
|
+
assert_difference "CompositeBook.count", +2 do
|
180
|
+
assert_difference "CompositeChapter.count", +4 do
|
181
|
+
CompositeBook.import books, recursive: true
|
182
|
+
end
|
183
|
+
end
|
184
|
+
end
|
185
|
+
end
|
157
186
|
end
|
158
187
|
end
|
159
188
|
|
@@ -167,7 +196,7 @@ def should_support_recursive_import
|
|
167
196
|
end
|
168
197
|
end
|
169
198
|
|
170
|
-
# If adapter supports on_duplicate_key_update, it is only applied to top level models so that SQL with invalid
|
199
|
+
# If adapter supports on_duplicate_key_update and specific columns are specified, it is only applied to top level models so that SQL with invalid
|
171
200
|
# columns, keys, etc isn't generated for child associations when doing recursive import
|
172
201
|
if ActiveRecord::Base.connection.supports_on_duplicate_key_update?
|
173
202
|
describe "on_duplicate_key_update" do
|
@@ -181,6 +210,113 @@ def should_support_recursive_import
|
|
181
210
|
end
|
182
211
|
end
|
183
212
|
end
|
213
|
+
|
214
|
+
context "when :all fields are updated" do
|
215
|
+
setup do
|
216
|
+
Topic.import new_topics, recursive: true
|
217
|
+
end
|
218
|
+
|
219
|
+
it "updates associated objects" do
|
220
|
+
new_author_name = 'Richard Bachman'
|
221
|
+
topic = new_topics.first
|
222
|
+
topic.books.each do |book|
|
223
|
+
book.author_name = new_author_name
|
224
|
+
end
|
225
|
+
assert_nothing_raised do
|
226
|
+
Topic.import new_topics, recursive: true, on_duplicate_key_update: :all
|
227
|
+
end
|
228
|
+
Topic.find(topic.id).books.each do |book|
|
229
|
+
assert_equal new_author_name, book.author_name
|
230
|
+
end
|
231
|
+
end
|
232
|
+
end
|
233
|
+
end
|
234
|
+
|
235
|
+
describe "recursive_on_duplicate_key_update" do
|
236
|
+
let(:new_topics) { Build(1, :topic_with_book) }
|
237
|
+
|
238
|
+
setup do
|
239
|
+
Topic.import new_topics, recursive: true
|
240
|
+
end
|
241
|
+
|
242
|
+
it "updates associated objects" do
|
243
|
+
new_author_name = 'Richard Bachman'
|
244
|
+
topic = new_topics.first
|
245
|
+
topic.books.each do |book|
|
246
|
+
book.author_name = new_author_name
|
247
|
+
end
|
248
|
+
|
249
|
+
assert_nothing_raised do
|
250
|
+
Topic.import new_topics,
|
251
|
+
recursive: true,
|
252
|
+
on_duplicate_key_update: [:id],
|
253
|
+
recursive_on_duplicate_key_update: {
|
254
|
+
books: { conflict_target: [:id], columns: [:author_name] }
|
255
|
+
}
|
256
|
+
end
|
257
|
+
Topic.find(topic.id).books.each do |book|
|
258
|
+
assert_equal new_author_name, book.author_name
|
259
|
+
end
|
260
|
+
end
|
261
|
+
|
262
|
+
it "updates nested associated objects" do
|
263
|
+
new_chapter_title = 'The Final Chapter'
|
264
|
+
book = new_topics.first.books.first
|
265
|
+
book.author_name = 'Richard Bachman'
|
266
|
+
|
267
|
+
example_chapter = book.chapters.first
|
268
|
+
example_chapter.title = new_chapter_title
|
269
|
+
|
270
|
+
assert_nothing_raised do
|
271
|
+
Topic.import new_topics,
|
272
|
+
recursive: true,
|
273
|
+
on_duplicate_key_update: [:id],
|
274
|
+
recursive_on_duplicate_key_update: {
|
275
|
+
books: { conflict_target: [:id], columns: [:author_name] },
|
276
|
+
chapters: { conflict_target: [:id], columns: [:title] }
|
277
|
+
}
|
278
|
+
end
|
279
|
+
assert_equal new_chapter_title, Chapter.find(example_chapter.id).title
|
280
|
+
end
|
281
|
+
|
282
|
+
context "when a non-standard association name is used" do
|
283
|
+
let(:new_topics) do
|
284
|
+
topic = Build(:topic)
|
285
|
+
|
286
|
+
2.times do
|
287
|
+
novel = topic.novels.build(title: FactoryBot.generate(:book_title), author_name: 'Stephen King')
|
288
|
+
3.times do
|
289
|
+
novel.chapters.build(title: FactoryBot.generate(:chapter_title))
|
290
|
+
end
|
291
|
+
|
292
|
+
4.times do
|
293
|
+
novel.end_notes.build(note: FactoryBot.generate(:end_note))
|
294
|
+
end
|
295
|
+
end
|
296
|
+
|
297
|
+
[topic]
|
298
|
+
end
|
299
|
+
|
300
|
+
it "updates nested associated objects" do
|
301
|
+
new_chapter_title = 'The Final Chapter'
|
302
|
+
novel = new_topics.first.novels.first
|
303
|
+
novel.author_name = 'Richard Bachman'
|
304
|
+
|
305
|
+
example_chapter = novel.chapters.first
|
306
|
+
example_chapter.title = new_chapter_title
|
307
|
+
|
308
|
+
assert_nothing_raised do
|
309
|
+
Topic.import new_topics,
|
310
|
+
recursive: true,
|
311
|
+
on_duplicate_key_update: [:id],
|
312
|
+
recursive_on_duplicate_key_update: {
|
313
|
+
novels: { conflict_target: [:id], columns: [:author_name] },
|
314
|
+
chapters: { conflict_target: [:id], columns: [:title] }
|
315
|
+
}
|
316
|
+
end
|
317
|
+
assert_equal new_chapter_title, Chapter.find(example_chapter.id).title
|
318
|
+
end
|
319
|
+
end
|
184
320
|
end
|
185
321
|
end
|
186
322
|
|
data/test/synchronize_test.rb
CHANGED
data/test/test_helper.rb
CHANGED
@@ -1,4 +1,7 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'pathname'
|
4
|
+
require 'rake'
|
2
5
|
test_dir = Pathname.new File.dirname(__FILE__)
|
3
6
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
4
7
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
@@ -10,19 +13,16 @@ ENV["RAILS_ENV"] = "test"
|
|
10
13
|
require "bundler"
|
11
14
|
Bundler.setup
|
12
15
|
|
13
|
-
|
16
|
+
unless RbConfig::CONFIG["RUBY_INSTALL_NAME"] =~ /jruby/
|
17
|
+
require 'pry'
|
18
|
+
require 'pry-byebug'
|
19
|
+
end
|
14
20
|
|
15
21
|
require "active_record"
|
16
22
|
require "active_record/fixtures"
|
17
23
|
require "active_support/test_case"
|
18
|
-
|
19
|
-
|
20
|
-
require 'test/unit'
|
21
|
-
require 'mocha/test_unit'
|
22
|
-
else
|
23
|
-
require 'active_support/testing/autorun'
|
24
|
-
require "mocha/mini_test"
|
25
|
-
end
|
24
|
+
require 'active_support/testing/autorun'
|
25
|
+
require "mocha/minitest"
|
26
26
|
|
27
27
|
require 'timecop'
|
28
28
|
require 'chronic'
|
@@ -30,26 +30,40 @@ require 'chronic'
|
|
30
30
|
begin
|
31
31
|
require 'composite_primary_keys'
|
32
32
|
rescue LoadError
|
33
|
-
ENV[
|
34
|
-
|
35
|
-
|
36
|
-
# Support MySQL 5.7
|
37
|
-
if ActiveSupport::VERSION::STRING < "4.1"
|
38
|
-
require "active_record/connection_adapters/mysql2_adapter"
|
39
|
-
class ActiveRecord::ConnectionAdapters::Mysql2Adapter
|
40
|
-
NATIVE_DATABASE_TYPES[:primary_key] = "int(11) auto_increment PRIMARY KEY"
|
33
|
+
if ENV['AR_VERSION'].to_f <= 7.1
|
34
|
+
ENV['SKIP_COMPOSITE_PK'] = 'true'
|
41
35
|
end
|
42
36
|
end
|
43
37
|
|
44
|
-
require "ruby-debug" if RUBY_VERSION.to_f < 1.9
|
45
|
-
|
46
38
|
adapter = ENV["ARE_DB"] || "sqlite3"
|
47
39
|
|
48
40
|
FileUtils.mkdir_p 'log'
|
49
41
|
ActiveRecord::Base.logger = Logger.new("log/test.log")
|
50
42
|
ActiveRecord::Base.logger.level = Logger::DEBUG
|
51
|
-
|
52
|
-
ActiveRecord
|
43
|
+
|
44
|
+
if ActiveRecord.respond_to?(:use_yaml_unsafe_load)
|
45
|
+
ActiveRecord.use_yaml_unsafe_load = true
|
46
|
+
elsif ActiveRecord::Base.respond_to?(:use_yaml_unsafe_load)
|
47
|
+
ActiveRecord::Base.use_yaml_unsafe_load = true
|
48
|
+
end
|
49
|
+
|
50
|
+
if ENV['AR_VERSION'].to_f >= 6.0
|
51
|
+
yaml_config = if Gem::Version.new(Psych::VERSION) >= Gem::Version.new('3.2.1')
|
52
|
+
YAML.safe_load_file(test_dir.join("database.yml"), aliases: true)[adapter]
|
53
|
+
else
|
54
|
+
YAML.load_file(test_dir.join("database.yml"))[adapter]
|
55
|
+
end
|
56
|
+
config = ActiveRecord::DatabaseConfigurations::HashConfig.new("test", adapter, yaml_config)
|
57
|
+
ActiveRecord::Base.configurations.configurations << config
|
58
|
+
else
|
59
|
+
ActiveRecord::Base.configurations["test"] = YAML.load_file(test_dir.join("database.yml"))[adapter]
|
60
|
+
end
|
61
|
+
|
62
|
+
if ActiveRecord.respond_to?(:default_timezone)
|
63
|
+
ActiveRecord.default_timezone = :utc
|
64
|
+
else
|
65
|
+
ActiveRecord::Base.default_timezone = :utc
|
66
|
+
end
|
53
67
|
|
54
68
|
require "activerecord-import"
|
55
69
|
ActiveRecord::Base.establish_connection :test
|
@@ -59,7 +73,7 @@ ActiveSupport::Notifications.subscribe(/active_record.sql/) do |_, _, _, _, hsh|
|
|
59
73
|
end
|
60
74
|
|
61
75
|
require "factory_bot"
|
62
|
-
Dir[File.dirname(__FILE__)
|
76
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].sort.each { |file| require file }
|
63
77
|
|
64
78
|
# Load base/generic schema
|
65
79
|
require test_dir.join("schema/version")
|
@@ -67,9 +81,9 @@ require test_dir.join("schema/generic_schema")
|
|
67
81
|
adapter_schema = test_dir.join("schema/#{adapter}_schema.rb")
|
68
82
|
require adapter_schema if File.exist?(adapter_schema)
|
69
83
|
|
70
|
-
Dir[File.dirname(__FILE__)
|
84
|
+
Dir["#{File.dirname(__FILE__)}/models/*.rb"].sort.each { |file| require file }
|
71
85
|
|
72
86
|
# Prevent this deprecation warning from breaking the tests.
|
73
87
|
Rake::FileList.send(:remove_method, :import)
|
74
88
|
|
75
|
-
ActiveSupport::TestCase.test_order = :random
|
89
|
+
ActiveSupport::TestCase.test_order = :random
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require File.expand_path("#{File.dirname(__FILE__)}/../test_helper")
|
4
|
+
require File.expand_path("#{File.dirname(__FILE__)}/../support/assertions")
|
5
|
+
require File.expand_path("#{File.dirname(__FILE__)}/../support/mysql/import_examples")
|
6
|
+
|
7
|
+
should_support_mysql_import_functionality
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-import
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zach Dennis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '4.2'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '4.2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -45,12 +45,13 @@ executables: []
|
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
|
+
- ".github/workflows/test.yaml"
|
48
49
|
- ".gitignore"
|
49
50
|
- ".rubocop.yml"
|
50
51
|
- ".rubocop_todo.yml"
|
51
|
-
- ".travis.yml"
|
52
52
|
- Brewfile
|
53
53
|
- CHANGELOG.md
|
54
|
+
- Dockerfile
|
54
55
|
- Gemfile
|
55
56
|
- LICENSE
|
56
57
|
- README.markdown
|
@@ -67,16 +68,15 @@ files:
|
|
67
68
|
- benchmarks/models/test_innodb.rb
|
68
69
|
- benchmarks/models/test_memory.rb
|
69
70
|
- benchmarks/models/test_myisam.rb
|
70
|
-
- benchmarks/schema/
|
71
|
-
-
|
72
|
-
- gemfiles/4.0.gemfile
|
73
|
-
- gemfiles/4.1.gemfile
|
74
|
-
- gemfiles/4.2.gemfile
|
75
|
-
- gemfiles/5.0.gemfile
|
76
|
-
- gemfiles/5.1.gemfile
|
71
|
+
- benchmarks/schema/mysql2_schema.rb
|
72
|
+
- docker-compose.yml
|
77
73
|
- gemfiles/5.2.gemfile
|
78
74
|
- gemfiles/6.0.gemfile
|
79
75
|
- gemfiles/6.1.gemfile
|
76
|
+
- gemfiles/7.0.gemfile
|
77
|
+
- gemfiles/7.1.gemfile
|
78
|
+
- gemfiles/7.2.gemfile
|
79
|
+
- gemfiles/8.0.gemfile
|
80
80
|
- lib/activerecord-import.rb
|
81
81
|
- lib/activerecord-import/active_record/adapters/abstract_adapter.rb
|
82
82
|
- lib/activerecord-import/active_record/adapters/jdbcmysql_adapter.rb
|
@@ -86,17 +86,16 @@ files:
|
|
86
86
|
- lib/activerecord-import/active_record/adapters/postgresql_adapter.rb
|
87
87
|
- lib/activerecord-import/active_record/adapters/seamless_database_pool_adapter.rb
|
88
88
|
- lib/activerecord-import/active_record/adapters/sqlite3_adapter.rb
|
89
|
+
- lib/activerecord-import/active_record/adapters/trilogy_adapter.rb
|
89
90
|
- lib/activerecord-import/adapters/abstract_adapter.rb
|
90
91
|
- lib/activerecord-import/adapters/em_mysql2_adapter.rb
|
91
92
|
- lib/activerecord-import/adapters/mysql2_adapter.rb
|
92
93
|
- lib/activerecord-import/adapters/mysql_adapter.rb
|
93
94
|
- lib/activerecord-import/adapters/postgresql_adapter.rb
|
94
95
|
- lib/activerecord-import/adapters/sqlite3_adapter.rb
|
96
|
+
- lib/activerecord-import/adapters/trilogy_adapter.rb
|
95
97
|
- lib/activerecord-import/base.rb
|
96
98
|
- lib/activerecord-import/import.rb
|
97
|
-
- lib/activerecord-import/mysql2.rb
|
98
|
-
- lib/activerecord-import/postgresql.rb
|
99
|
-
- lib/activerecord-import/sqlite3.rb
|
100
99
|
- lib/activerecord-import/synchronize.rb
|
101
100
|
- lib/activerecord-import/value_sets_parser.rb
|
102
101
|
- lib/activerecord-import/version.rb
|
@@ -113,7 +112,9 @@ files:
|
|
113
112
|
- test/adapters/seamless_database_pool.rb
|
114
113
|
- test/adapters/spatialite.rb
|
115
114
|
- test/adapters/sqlite3.rb
|
115
|
+
- test/adapters/trilogy.rb
|
116
116
|
- test/database.yml.sample
|
117
|
+
- test/github/database.yml
|
117
118
|
- test/import_test.rb
|
118
119
|
- test/jdbcmysql/import_test.rb
|
119
120
|
- test/jdbcpostgresql/import_test.rb
|
@@ -121,18 +122,28 @@ files:
|
|
121
122
|
- test/makara_postgis/import_test.rb
|
122
123
|
- test/models/account.rb
|
123
124
|
- test/models/alarm.rb
|
125
|
+
- test/models/animal.rb
|
126
|
+
- test/models/author.rb
|
124
127
|
- test/models/bike_maker.rb
|
125
128
|
- test/models/book.rb
|
126
129
|
- test/models/car.rb
|
130
|
+
- test/models/card.rb
|
127
131
|
- test/models/chapter.rb
|
132
|
+
- test/models/composite_book.rb
|
133
|
+
- test/models/composite_chapter.rb
|
134
|
+
- test/models/customer.rb
|
135
|
+
- test/models/deck.rb
|
128
136
|
- test/models/dictionary.rb
|
129
137
|
- test/models/discount.rb
|
130
138
|
- test/models/end_note.rb
|
131
139
|
- test/models/group.rb
|
140
|
+
- test/models/order.rb
|
141
|
+
- test/models/playing_card.rb
|
132
142
|
- test/models/promotion.rb
|
133
143
|
- test/models/question.rb
|
134
144
|
- test/models/rule.rb
|
135
145
|
- test/models/tag.rb
|
146
|
+
- test/models/tag_alias.rb
|
136
147
|
- test/models/topic.rb
|
137
148
|
- test/models/user.rb
|
138
149
|
- test/models/user_token.rb
|
@@ -163,13 +174,14 @@ files:
|
|
163
174
|
- test/support/sqlite3/import_examples.rb
|
164
175
|
- test/synchronize_test.rb
|
165
176
|
- test/test_helper.rb
|
166
|
-
- test/
|
177
|
+
- test/trilogy/import_test.rb
|
167
178
|
- test/value_sets_bytes_parser_test.rb
|
168
179
|
- test/value_sets_records_parser_test.rb
|
169
|
-
homepage:
|
180
|
+
homepage: https://github.com/zdennis/activerecord-import
|
170
181
|
licenses:
|
171
|
-
-
|
172
|
-
metadata:
|
182
|
+
- MIT
|
183
|
+
metadata:
|
184
|
+
changelog_uri: https://github.com/zdennis/activerecord-import/blob/master/CHANGELOG.md
|
173
185
|
post_install_message:
|
174
186
|
rdoc_options: []
|
175
187
|
require_paths:
|
@@ -178,14 +190,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
178
190
|
requirements:
|
179
191
|
- - ">="
|
180
192
|
- !ruby/object:Gem::Version
|
181
|
-
version:
|
193
|
+
version: 2.4.0
|
182
194
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
183
195
|
requirements:
|
184
196
|
- - ">="
|
185
197
|
- !ruby/object:Gem::Version
|
186
198
|
version: '0'
|
187
199
|
requirements: []
|
188
|
-
rubygems_version: 3.0.
|
200
|
+
rubygems_version: 3.0.3.1
|
189
201
|
signing_key:
|
190
202
|
specification_version: 4
|
191
203
|
summary: Bulk insert extension for ActiveRecord
|
@@ -203,7 +215,9 @@ test_files:
|
|
203
215
|
- test/adapters/seamless_database_pool.rb
|
204
216
|
- test/adapters/spatialite.rb
|
205
217
|
- test/adapters/sqlite3.rb
|
218
|
+
- test/adapters/trilogy.rb
|
206
219
|
- test/database.yml.sample
|
220
|
+
- test/github/database.yml
|
207
221
|
- test/import_test.rb
|
208
222
|
- test/jdbcmysql/import_test.rb
|
209
223
|
- test/jdbcpostgresql/import_test.rb
|
@@ -211,18 +225,28 @@ test_files:
|
|
211
225
|
- test/makara_postgis/import_test.rb
|
212
226
|
- test/models/account.rb
|
213
227
|
- test/models/alarm.rb
|
228
|
+
- test/models/animal.rb
|
229
|
+
- test/models/author.rb
|
214
230
|
- test/models/bike_maker.rb
|
215
231
|
- test/models/book.rb
|
216
232
|
- test/models/car.rb
|
233
|
+
- test/models/card.rb
|
217
234
|
- test/models/chapter.rb
|
235
|
+
- test/models/composite_book.rb
|
236
|
+
- test/models/composite_chapter.rb
|
237
|
+
- test/models/customer.rb
|
238
|
+
- test/models/deck.rb
|
218
239
|
- test/models/dictionary.rb
|
219
240
|
- test/models/discount.rb
|
220
241
|
- test/models/end_note.rb
|
221
242
|
- test/models/group.rb
|
243
|
+
- test/models/order.rb
|
244
|
+
- test/models/playing_card.rb
|
222
245
|
- test/models/promotion.rb
|
223
246
|
- test/models/question.rb
|
224
247
|
- test/models/rule.rb
|
225
248
|
- test/models/tag.rb
|
249
|
+
- test/models/tag_alias.rb
|
226
250
|
- test/models/topic.rb
|
227
251
|
- test/models/user.rb
|
228
252
|
- test/models/user_token.rb
|
@@ -253,6 +277,6 @@ test_files:
|
|
253
277
|
- test/support/sqlite3/import_examples.rb
|
254
278
|
- test/synchronize_test.rb
|
255
279
|
- test/test_helper.rb
|
256
|
-
- test/
|
280
|
+
- test/trilogy/import_test.rb
|
257
281
|
- test/value_sets_bytes_parser_test.rb
|
258
282
|
- test/value_sets_records_parser_test.rb
|
data/.travis.yml
DELETED
@@ -1,74 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
cache: bundler
|
3
|
-
rvm:
|
4
|
-
- 2.5.5
|
5
|
-
|
6
|
-
env:
|
7
|
-
global:
|
8
|
-
# https://github.com/discourse/discourse/blob/master/.travis.yml
|
9
|
-
- RUBY_GC_MALLOC_LIMIT=50000000
|
10
|
-
matrix:
|
11
|
-
- AR_VERSION=5.1
|
12
|
-
- AR_VERSION=5.2
|
13
|
-
- AR_VERSION=6.0
|
14
|
-
|
15
|
-
matrix:
|
16
|
-
include:
|
17
|
-
- rvm: 2.3.8
|
18
|
-
env: AR_VERSION=3.2
|
19
|
-
- rvm: 2.3.8
|
20
|
-
env: AR_VERSION=4.0
|
21
|
-
- rvm: 2.3.8
|
22
|
-
env: AR_VERSION=4.1
|
23
|
-
- rvm: 2.3.8
|
24
|
-
env: AR_VERSION=4.2
|
25
|
-
- rvm: 2.3.8
|
26
|
-
env: AR_VERSION=5.0
|
27
|
-
|
28
|
-
fast_finish: true
|
29
|
-
|
30
|
-
addons:
|
31
|
-
postgresql: "9.5"
|
32
|
-
apt:
|
33
|
-
sources:
|
34
|
-
- travis-ci/sqlite3
|
35
|
-
- mysql-5.7-trusty
|
36
|
-
packages:
|
37
|
-
- sqlite3
|
38
|
-
- mysql-server
|
39
|
-
- mysql-client
|
40
|
-
- postgresql-9.5-postgis-2.4
|
41
|
-
|
42
|
-
before_install:
|
43
|
-
- gem update --system
|
44
|
-
- sudo mysql -e "use mysql; update user set authentication_string=PASSWORD('') where User='root'; update user set plugin='mysql_native_password';FLUSH PRIVILEGES;"
|
45
|
-
- sudo mysql_upgrade
|
46
|
-
- sudo service mysql restart
|
47
|
-
|
48
|
-
before_script:
|
49
|
-
- mysql -e 'create database activerecord_import_test;'
|
50
|
-
- psql -c 'create database activerecord_import_test;' -U postgres
|
51
|
-
- psql activerecord_import_test -c 'create extension if not exists hstore;' -U postgres
|
52
|
-
- psql -c 'create extension if not exists postgis;' -U postgres
|
53
|
-
- psql -c 'create extension if not exists "uuid-ossp";' -U postgres
|
54
|
-
- cp test/travis/database.yml test/database.yml
|
55
|
-
|
56
|
-
script:
|
57
|
-
- bundle exec rake test:mysql2
|
58
|
-
- bundle exec rake test:mysql2_makara
|
59
|
-
- bundle exec rake test:mysql2spatial
|
60
|
-
- bundle exec rake test:postgis
|
61
|
-
- bundle exec rake test:postgresql
|
62
|
-
- bundle exec rake test:postgresql_makara
|
63
|
-
- bundle exec rake test:seamless_database_pool
|
64
|
-
- bundle exec rake test:spatialite
|
65
|
-
- bundle exec rake test:sqlite3
|
66
|
-
- bundle exec rubocop
|
67
|
-
|
68
|
-
dist: xenial
|
69
|
-
|
70
|
-
services:
|
71
|
-
- mysql
|
72
|
-
- postgresql
|
73
|
-
|
74
|
-
sudo: required
|
data/gemfiles/3.2.gemfile
DELETED
data/gemfiles/4.0.gemfile
DELETED
data/gemfiles/4.1.gemfile
DELETED
data/gemfiles/4.2.gemfile
DELETED
data/gemfiles/5.0.gemfile
DELETED
data/gemfiles/5.1.gemfile
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
warn <<-MSG
|
2
|
-
[DEPRECATION] loading activerecord-import via 'require "activerecord-import/<adapter-name>"'
|
3
|
-
is deprecated. Update to autorequire using 'require "activerecord-import"'. See
|
4
|
-
http://github.com/zdennis/activerecord-import/wiki/Requiring for more information
|
5
|
-
MSG
|
6
|
-
|
7
|
-
require "activerecord-import"
|
@@ -1,7 +0,0 @@
|
|
1
|
-
warn <<-MSG
|
2
|
-
[DEPRECATION] loading activerecord-import via 'require "activerecord-import/<adapter-name>"'
|
3
|
-
is deprecated. Update to autorequire using 'require "activerecord-import"'. See
|
4
|
-
http://github.com/zdennis/activerecord-import/wiki/Requiring for more information
|
5
|
-
MSG
|
6
|
-
|
7
|
-
require "activerecord-import"
|
@@ -1,7 +0,0 @@
|
|
1
|
-
warn <<-MSG
|
2
|
-
[DEPRECATION] loading activerecord-import via 'require "activerecord-import/<adapter-name>"'
|
3
|
-
is deprecated. Update to autorequire using 'require "activerecord-import"'. See
|
4
|
-
http://github.com/zdennis/activerecord-import/wiki/Requiring for more information
|
5
|
-
MSG
|
6
|
-
|
7
|
-
require "activerecord-import"
|