activerecord-import 0.23.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.github/workflows/test.yaml +107 -0
- data/.gitignore +1 -0
- data/CHANGELOG.md +214 -4
- data/Gemfile +11 -9
- data/LICENSE +21 -56
- data/README.markdown +574 -22
- data/Rakefile +2 -1
- data/activerecord-import.gemspec +4 -4
- data/benchmarks/benchmark.rb +5 -1
- data/benchmarks/schema/{mysql_schema.rb → mysql2_schema.rb} +0 -0
- data/gemfiles/5.0.gemfile +1 -0
- data/gemfiles/5.1.gemfile +1 -0
- data/gemfiles/5.2.gemfile +2 -2
- data/gemfiles/6.0.gemfile +2 -0
- data/gemfiles/6.1.gemfile +2 -0
- data/gemfiles/7.0.gemfile +1 -0
- data/lib/activerecord-import/active_record/adapters/jdbcmysql_adapter.rb +4 -4
- data/lib/activerecord-import/adapters/abstract_adapter.rb +7 -1
- data/lib/activerecord-import/adapters/mysql_adapter.rb +8 -11
- data/lib/activerecord-import/adapters/postgresql_adapter.rb +14 -16
- data/lib/activerecord-import/adapters/sqlite3_adapter.rb +125 -8
- data/lib/activerecord-import/base.rb +9 -1
- data/lib/activerecord-import/import.rb +269 -123
- data/lib/activerecord-import/synchronize.rb +2 -2
- data/lib/activerecord-import/value_sets_parser.rb +2 -0
- data/lib/activerecord-import/version.rb +1 -1
- data/lib/activerecord-import.rb +1 -0
- data/test/adapters/makara_postgis.rb +1 -0
- data/test/{travis → github}/database.yml +3 -1
- data/test/import_test.rb +138 -8
- data/test/makara_postgis/import_test.rb +8 -0
- data/test/models/animal.rb +6 -0
- data/test/models/card.rb +3 -0
- data/test/models/customer.rb +6 -0
- data/test/models/deck.rb +6 -0
- data/test/models/order.rb +6 -0
- data/test/models/playing_card.rb +2 -0
- data/test/models/user.rb +3 -1
- data/test/models/user_token.rb +4 -0
- data/test/schema/generic_schema.rb +30 -0
- data/test/schema/mysql2_schema.rb +19 -0
- data/test/schema/postgresql_schema.rb +16 -0
- data/test/schema/sqlite3_schema.rb +13 -0
- data/test/support/factories.rb +8 -8
- data/test/support/generate.rb +6 -6
- data/test/support/mysql/import_examples.rb +12 -0
- data/test/support/postgresql/import_examples.rb +100 -2
- data/test/support/shared_examples/on_duplicate_key_update.rb +54 -0
- data/test/support/shared_examples/recursive_import.rb +74 -4
- data/test/support/sqlite3/import_examples.rb +189 -25
- data/test/test_helper.rb +28 -3
- metadata +37 -18
- data/.travis.yml +0 -62
- data/gemfiles/3.2.gemfile +0 -2
- data/gemfiles/4.0.gemfile +0 -2
- data/gemfiles/4.1.gemfile +0 -2
- data/test/schema/mysql_schema.rb +0 -16
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: 1.4.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: 2022-03-31 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,10 +45,10 @@ 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
54
|
- Gemfile
|
@@ -67,14 +67,14 @@ files:
|
|
67
67
|
- benchmarks/models/test_innodb.rb
|
68
68
|
- benchmarks/models/test_memory.rb
|
69
69
|
- benchmarks/models/test_myisam.rb
|
70
|
-
- benchmarks/schema/
|
71
|
-
- gemfiles/3.2.gemfile
|
72
|
-
- gemfiles/4.0.gemfile
|
73
|
-
- gemfiles/4.1.gemfile
|
70
|
+
- benchmarks/schema/mysql2_schema.rb
|
74
71
|
- gemfiles/4.2.gemfile
|
75
72
|
- gemfiles/5.0.gemfile
|
76
73
|
- gemfiles/5.1.gemfile
|
77
74
|
- gemfiles/5.2.gemfile
|
75
|
+
- gemfiles/6.0.gemfile
|
76
|
+
- gemfiles/6.1.gemfile
|
77
|
+
- gemfiles/7.0.gemfile
|
78
78
|
- lib/activerecord-import.rb
|
79
79
|
- lib/activerecord-import/active_record/adapters/abstract_adapter.rb
|
80
80
|
- lib/activerecord-import/active_record/adapters/jdbcmysql_adapter.rb
|
@@ -101,6 +101,7 @@ files:
|
|
101
101
|
- test/adapters/jdbcmysql.rb
|
102
102
|
- test/adapters/jdbcpostgresql.rb
|
103
103
|
- test/adapters/jdbcsqlite3.rb
|
104
|
+
- test/adapters/makara_postgis.rb
|
104
105
|
- test/adapters/mysql2.rb
|
105
106
|
- test/adapters/mysql2_makara.rb
|
106
107
|
- test/adapters/mysql2spatial.rb
|
@@ -111,26 +112,35 @@ files:
|
|
111
112
|
- test/adapters/spatialite.rb
|
112
113
|
- test/adapters/sqlite3.rb
|
113
114
|
- test/database.yml.sample
|
115
|
+
- test/github/database.yml
|
114
116
|
- test/import_test.rb
|
115
117
|
- test/jdbcmysql/import_test.rb
|
116
118
|
- test/jdbcpostgresql/import_test.rb
|
117
119
|
- test/jdbcsqlite3/import_test.rb
|
120
|
+
- test/makara_postgis/import_test.rb
|
118
121
|
- test/models/account.rb
|
119
122
|
- test/models/alarm.rb
|
123
|
+
- test/models/animal.rb
|
120
124
|
- test/models/bike_maker.rb
|
121
125
|
- test/models/book.rb
|
122
126
|
- test/models/car.rb
|
127
|
+
- test/models/card.rb
|
123
128
|
- test/models/chapter.rb
|
129
|
+
- test/models/customer.rb
|
130
|
+
- test/models/deck.rb
|
124
131
|
- test/models/dictionary.rb
|
125
132
|
- test/models/discount.rb
|
126
133
|
- test/models/end_note.rb
|
127
134
|
- test/models/group.rb
|
135
|
+
- test/models/order.rb
|
136
|
+
- test/models/playing_card.rb
|
128
137
|
- test/models/promotion.rb
|
129
138
|
- test/models/question.rb
|
130
139
|
- test/models/rule.rb
|
131
140
|
- test/models/tag.rb
|
132
141
|
- test/models/topic.rb
|
133
142
|
- test/models/user.rb
|
143
|
+
- test/models/user_token.rb
|
134
144
|
- test/models/vendor.rb
|
135
145
|
- test/models/widget.rb
|
136
146
|
- test/mysql2/import_test.rb
|
@@ -140,9 +150,10 @@ files:
|
|
140
150
|
- test/postgresql/import_test.rb
|
141
151
|
- test/schema/generic_schema.rb
|
142
152
|
- test/schema/jdbcpostgresql_schema.rb
|
143
|
-
- test/schema/
|
153
|
+
- test/schema/mysql2_schema.rb
|
144
154
|
- test/schema/postgis_schema.rb
|
145
155
|
- test/schema/postgresql_schema.rb
|
156
|
+
- test/schema/sqlite3_schema.rb
|
146
157
|
- test/schema/version.rb
|
147
158
|
- test/sqlite3/import_test.rb
|
148
159
|
- test/support/active_support/test_case_extensions.rb
|
@@ -157,12 +168,11 @@ files:
|
|
157
168
|
- test/support/sqlite3/import_examples.rb
|
158
169
|
- test/synchronize_test.rb
|
159
170
|
- test/test_helper.rb
|
160
|
-
- test/travis/database.yml
|
161
171
|
- test/value_sets_bytes_parser_test.rb
|
162
172
|
- test/value_sets_records_parser_test.rb
|
163
|
-
homepage:
|
173
|
+
homepage: https://github.com/zdennis/activerecord-import
|
164
174
|
licenses:
|
165
|
-
-
|
175
|
+
- MIT
|
166
176
|
metadata: {}
|
167
177
|
post_install_message:
|
168
178
|
rdoc_options: []
|
@@ -172,15 +182,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
172
182
|
requirements:
|
173
183
|
- - ">="
|
174
184
|
- !ruby/object:Gem::Version
|
175
|
-
version:
|
185
|
+
version: 2.4.0
|
176
186
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
177
187
|
requirements:
|
178
188
|
- - ">="
|
179
189
|
- !ruby/object:Gem::Version
|
180
190
|
version: '0'
|
181
191
|
requirements: []
|
182
|
-
|
183
|
-
rubygems_version: 2.6.13
|
192
|
+
rubygems_version: 3.0.3
|
184
193
|
signing_key:
|
185
194
|
specification_version: 4
|
186
195
|
summary: Bulk insert extension for ActiveRecord
|
@@ -188,6 +197,7 @@ test_files:
|
|
188
197
|
- test/adapters/jdbcmysql.rb
|
189
198
|
- test/adapters/jdbcpostgresql.rb
|
190
199
|
- test/adapters/jdbcsqlite3.rb
|
200
|
+
- test/adapters/makara_postgis.rb
|
191
201
|
- test/adapters/mysql2.rb
|
192
202
|
- test/adapters/mysql2_makara.rb
|
193
203
|
- test/adapters/mysql2spatial.rb
|
@@ -198,26 +208,35 @@ test_files:
|
|
198
208
|
- test/adapters/spatialite.rb
|
199
209
|
- test/adapters/sqlite3.rb
|
200
210
|
- test/database.yml.sample
|
211
|
+
- test/github/database.yml
|
201
212
|
- test/import_test.rb
|
202
213
|
- test/jdbcmysql/import_test.rb
|
203
214
|
- test/jdbcpostgresql/import_test.rb
|
204
215
|
- test/jdbcsqlite3/import_test.rb
|
216
|
+
- test/makara_postgis/import_test.rb
|
205
217
|
- test/models/account.rb
|
206
218
|
- test/models/alarm.rb
|
219
|
+
- test/models/animal.rb
|
207
220
|
- test/models/bike_maker.rb
|
208
221
|
- test/models/book.rb
|
209
222
|
- test/models/car.rb
|
223
|
+
- test/models/card.rb
|
210
224
|
- test/models/chapter.rb
|
225
|
+
- test/models/customer.rb
|
226
|
+
- test/models/deck.rb
|
211
227
|
- test/models/dictionary.rb
|
212
228
|
- test/models/discount.rb
|
213
229
|
- test/models/end_note.rb
|
214
230
|
- test/models/group.rb
|
231
|
+
- test/models/order.rb
|
232
|
+
- test/models/playing_card.rb
|
215
233
|
- test/models/promotion.rb
|
216
234
|
- test/models/question.rb
|
217
235
|
- test/models/rule.rb
|
218
236
|
- test/models/tag.rb
|
219
237
|
- test/models/topic.rb
|
220
238
|
- test/models/user.rb
|
239
|
+
- test/models/user_token.rb
|
221
240
|
- test/models/vendor.rb
|
222
241
|
- test/models/widget.rb
|
223
242
|
- test/mysql2/import_test.rb
|
@@ -227,9 +246,10 @@ test_files:
|
|
227
246
|
- test/postgresql/import_test.rb
|
228
247
|
- test/schema/generic_schema.rb
|
229
248
|
- test/schema/jdbcpostgresql_schema.rb
|
230
|
-
- test/schema/
|
249
|
+
- test/schema/mysql2_schema.rb
|
231
250
|
- test/schema/postgis_schema.rb
|
232
251
|
- test/schema/postgresql_schema.rb
|
252
|
+
- test/schema/sqlite3_schema.rb
|
233
253
|
- test/schema/version.rb
|
234
254
|
- test/sqlite3/import_test.rb
|
235
255
|
- test/support/active_support/test_case_extensions.rb
|
@@ -244,6 +264,5 @@ test_files:
|
|
244
264
|
- test/support/sqlite3/import_examples.rb
|
245
265
|
- test/synchronize_test.rb
|
246
266
|
- test/test_helper.rb
|
247
|
-
- test/travis/database.yml
|
248
267
|
- test/value_sets_bytes_parser_test.rb
|
249
268
|
- test/value_sets_records_parser_test.rb
|
data/.travis.yml
DELETED
@@ -1,62 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
cache: bundler
|
3
|
-
rvm:
|
4
|
-
- 2.3.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=3.2
|
12
|
-
- AR_VERSION=4.0
|
13
|
-
- AR_VERSION=4.1
|
14
|
-
- AR_VERSION=4.2
|
15
|
-
- AR_VERSION=5.0
|
16
|
-
- AR_VERSION=5.1
|
17
|
-
- AR_VERSION=5.2
|
18
|
-
|
19
|
-
matrix:
|
20
|
-
include:
|
21
|
-
- rvm: jruby-9.1.14.0
|
22
|
-
env: AR_VERSION=4.2
|
23
|
-
before_install:
|
24
|
-
- gem update --system
|
25
|
-
|
26
|
-
script:
|
27
|
-
- bundle exec rake test:jdbcsqlite3
|
28
|
-
- bundle exec rake test:jdbcmysql
|
29
|
-
- bundle exec rake test:jdbcpostgresql
|
30
|
-
|
31
|
-
fast_finish: true
|
32
|
-
|
33
|
-
before_script:
|
34
|
-
- mysql -e 'create database activerecord_import_test;'
|
35
|
-
- psql -c 'create database activerecord_import_test;' -U postgres
|
36
|
-
- psql activerecord_import_test -c 'create extension if not exists hstore;' -U postgres
|
37
|
-
- psql -c 'create extension if not exists postgis;' -U postgres
|
38
|
-
- psql -c 'create extension if not exists "uuid-ossp";' -U postgres
|
39
|
-
- cp test/travis/database.yml test/database.yml
|
40
|
-
|
41
|
-
addons:
|
42
|
-
postgresql: "9.5"
|
43
|
-
apt:
|
44
|
-
sources:
|
45
|
-
- travis-ci/sqlite3
|
46
|
-
packages:
|
47
|
-
- sqlite3
|
48
|
-
- postgresql-9.5-postgis-2.3
|
49
|
-
|
50
|
-
script:
|
51
|
-
- bundle exec rake test:mysql2
|
52
|
-
- bundle exec rake test:mysql2_makara
|
53
|
-
- bundle exec rake test:mysql2spatial
|
54
|
-
- bundle exec rake test:postgis
|
55
|
-
- bundle exec rake test:postgresql
|
56
|
-
- bundle exec rake test:postgresql_makara
|
57
|
-
- bundle exec rake test:seamless_database_pool
|
58
|
-
- bundle exec rake test:spatialite
|
59
|
-
- bundle exec rake test:sqlite3
|
60
|
-
- bundle exec rubocop
|
61
|
-
|
62
|
-
dist: trusty
|
data/gemfiles/3.2.gemfile
DELETED
data/gemfiles/4.0.gemfile
DELETED
data/gemfiles/4.1.gemfile
DELETED
data/test/schema/mysql_schema.rb
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
ActiveRecord::Schema.define do
|
2
|
-
create_table :books, options: 'ENGINE=MyISAM', force: true do |t|
|
3
|
-
t.column :title, :string, null: false
|
4
|
-
t.column :publisher, :string, null: false, default: 'Default Publisher'
|
5
|
-
t.column :author_name, :string, null: false
|
6
|
-
t.column :created_at, :datetime
|
7
|
-
t.column :created_on, :datetime
|
8
|
-
t.column :updated_at, :datetime
|
9
|
-
t.column :updated_on, :datetime
|
10
|
-
t.column :publish_date, :date
|
11
|
-
t.column :topic_id, :integer
|
12
|
-
t.column :for_sale, :boolean, default: true
|
13
|
-
t.column :status, :integer
|
14
|
-
end
|
15
|
-
execute "ALTER TABLE books ADD FULLTEXT( `title`, `publisher`, `author_name` )"
|
16
|
-
end
|