bulk_insert 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: da3b8a0be5e2ad8c7dcf5bbf878cc31383d1e63e
4
- data.tar.gz: 0c8f3ce86746632b0cdf34fec6c9c8021574aa8b
3
+ metadata.gz: 441f604c7dcfaa00902f46fca07f376559fed7ce
4
+ data.tar.gz: 9a00313cc43ed9aa6fb704e9b0ba600015b10599
5
5
  SHA512:
6
- metadata.gz: b6c9b2dce1635af1c59f34dffd49c1d276d68478222ab0ca8f1941ac2333e7196f2bc7e1ce9425b9c5ed4f1b43828ea8d3c3f51cda45498a7b744d15cfbfc26e
7
- data.tar.gz: ef556ebbf06358c534f3f0292ff5a4d2f53102a2c5faf1f22362964c8361f224ed932d54a27d24df397766de7f68c66eec6bbfa1014de505623b9199111e554f
6
+ metadata.gz: e8b779e68d0f0ab4fcaf9699e38ce2a56962c95edaf615d0952713e28b6d0e95ef0ffe42da46101b5b4bcbba8b8e334d7ac259f7c903770c33b30fefcab67e90
7
+ data.tar.gz: c37eaf99e2ec09a9b1b9328eca84274130677b3ed6cf5a23b91abd358ef8fbff83b1cd6101481a783af2dd9542b0a5cdd4956fe6375b2f720c711ad5a5512733
data/README.md CHANGED
@@ -128,6 +128,28 @@ Book.bulk_insert do |worker|
128
128
  end
129
129
  ```
130
130
 
131
+ ### Insert Ignore
132
+
133
+ By default, when an insert fails the whole batch of inserts fail. The
134
+ _ignore_ option ignores the inserts that would have failed (because of
135
+ duplicate keys or a null in column with a not null constraint) and
136
+ inserts the rest of the batch.
137
+
138
+ This is not the default because no errors are raised for the bad
139
+ inserts in the batch.
140
+
141
+ ```ruby
142
+ destination_columns = [:title, :author]
143
+
144
+ # Ignore bad inserts in the batch
145
+ Book.bulk_insert(*destination_columns, ignore: true) do |worker|
146
+ worker.add(...)
147
+ worker.add(...)
148
+ # ...
149
+ end
150
+ ```
151
+
152
+
131
153
  ## License
132
154
 
133
155
  BulkInsert is released under the MIT license (see MIT-LICENSE) by
@@ -4,9 +4,9 @@ module BulkInsert
4
4
  extend ActiveSupport::Concern
5
5
 
6
6
  module ClassMethods
7
- def bulk_insert(*columns, values: nil, set_size:500)
7
+ def bulk_insert(*columns, values: nil, set_size:500, ignore: false)
8
8
  columns = default_bulk_columns if columns.empty?
9
- worker = BulkInsert::Worker.new(connection, table_name, columns, set_size)
9
+ worker = BulkInsert::Worker.new(connection, table_name, columns, set_size, ignore)
10
10
 
11
11
  if values.present?
12
12
  transaction do
@@ -33,4 +33,6 @@ module BulkInsert
33
33
  end
34
34
  end
35
35
 
36
- ActiveRecord::Base.send :include, BulkInsert
36
+ ActiveSupport.on_load(:active_record) do
37
+ send(:include, BulkInsert)
38
+ end
@@ -1,6 +1,6 @@
1
1
  module BulkInsert
2
2
  MAJOR = 1
3
- MINOR = 3
3
+ MINOR = 4
4
4
  TINY = 0
5
5
 
6
6
  VERSION = [MAJOR, MINOR, TINY].join(".")
@@ -4,9 +4,11 @@ module BulkInsert
4
4
  attr_accessor :set_size
5
5
  attr_accessor :after_save_callback
6
6
 
7
- def initialize(connection, table_name, column_names, set_size=500)
7
+ def initialize(connection, table_name, column_names, set_size=500, ignore=false)
8
8
  @connection = connection
9
9
  @set_size = set_size
10
+ # INSERT IGNORE only fails inserts with duplicate keys or unallowed nulls not the whole set of inserts
11
+ @ignore = ignore ? "IGNORE" : nil
10
12
 
11
13
  columns = connection.columns(table_name)
12
14
  column_map = columns.inject({}) { |h, c| h.update(c.name => c) }
@@ -62,7 +64,7 @@ module BulkInsert
62
64
 
63
65
  def save!
64
66
  if pending?
65
- sql = "INSERT INTO #{@table_name} (#{@column_names}) VALUES "
67
+ sql = "INSERT #{@ignore} INTO #{@table_name} (#{@column_names}) VALUES "
66
68
  @now = Time.now
67
69
 
68
70
  rows = []
@@ -3108,3 +3108,289 @@ BulkInsertWorkerTest: test_add_should_use_database_default_values_when_present
3108
3108
   (0.1ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',20,'f','2016-11-01 17:59:20.918117','2016-11-01 17:59:20.918117','chartreuse')
3109
3109
  Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
3110
3110
   (0.2ms) rollback transaction
3111
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
3112
+  (0.1ms) begin transaction
3113
+ -------------------------------------------------------------------
3114
+ BulkInsertWorkerTest: test_after_save_callback_can_be_set_as_a_proc
3115
+ -------------------------------------------------------------------
3116
+  (0.0ms) rollback transaction
3117
+  (0.0ms) begin transaction
3118
+ ----------------------------------------------------------------------------------------------
3119
+ BulkInsertWorkerTest: test_default_timestamp_columns_should_be_equivalent_for_the_entire_batch
3120
+ ----------------------------------------------------------------------------------------------
3121
+  (0.8ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-02-11 23:45:39.546535','2017-02-11 23:45:39.546535','chartreuse'),('Howdy',20,'f','2017-02-11 23:45:39.546535','2017-02-11 23:45:39.546535','chartreuse')
3122
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings"
3123
+  (0.3ms) rollback transaction
3124
+  (0.0ms) begin transaction
3125
+ ------------------------------------------------------------------------------
3126
+ BulkInsertWorkerTest: test_add_should_use_database_default_values_when_present
3127
+ ------------------------------------------------------------------------------
3128
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',20,'f','2017-02-11 23:45:39.554824','2017-02-11 23:45:39.554824','chartreuse')
3129
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
3130
+  (0.3ms) rollback transaction
3131
+  (0.0ms) begin transaction
3132
+ --------------------------------------------------------
3133
+ BulkInsertWorkerTest: test_save!_inserts_pending_records
3134
+ --------------------------------------------------------
3135
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',15,'f','2017-02-11 23:45:39.557371','2017-02-11 23:45:39.557371','chartreuse'),('Hello',25,'t','2017-02-11 23:45:39.557371','2017-02-11 23:45:39.557371','chartreuse')
3136
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
3137
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
3138
+  (0.3ms) rollback transaction
3139
+  (0.0ms) begin transaction
3140
+ ----------------------------------------------------------------------------
3141
+ BulkInsertWorkerTest: test_pending_count_should_describe_size_of_pending_set
3142
+ ----------------------------------------------------------------------------
3143
+  (0.0ms) rollback transaction
3144
+  (0.0ms) begin transaction
3145
+ -------------------------------------------------------------------------------
3146
+ BulkInsertWorkerTest: test_add_should_default_timestamp_columns_to_current_time
3147
+ -------------------------------------------------------------------------------
3148
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-02-11 23:45:39.563471','2017-02-11 23:45:39.563471','chartreuse')
3149
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
3150
+  (0.3ms) rollback transaction
3151
+  (0.0ms) begin transaction
3152
+ ----------------------------------------------------------------------------------
3153
+ BulkInsertWorkerTest: test_add_should_save_automatically_when_overflowing_set_size
3154
+ ----------------------------------------------------------------------------------
3155
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-02-11 23:45:39.564977','2017-02-11 23:45:39.564977','chartreuse')
3156
+  (0.1ms) SELECT COUNT(*) FROM "testings"
3157
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
3158
+  (0.2ms) rollback transaction
3159
+  (0.1ms) begin transaction
3160
+ -------------------------------------------------------------------
3161
+ BulkInsertWorkerTest: test_save!_when_not_pending_should_do_nothing
3162
+ -------------------------------------------------------------------
3163
+  (0.0ms) SELECT COUNT(*) FROM "testings"
3164
+  (0.0ms) SELECT COUNT(*) FROM "testings"
3165
+  (0.0ms) rollback transaction
3166
+  (0.1ms) begin transaction
3167
+ -------------------------------------------------------------
3168
+ BulkInsertWorkerTest: test_save!_calls_the_after_save_handler
3169
+ -------------------------------------------------------------
3170
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',15,'f','2017-02-11 23:45:39.567512','2017-02-11 23:45:39.567512','chartreuse'),('Hello',25,'t','2017-02-11 23:45:39.567512','2017-02-11 23:45:39.567512','chartreuse')
3171
+  (0.2ms) rollback transaction
3172
+  (0.1ms) begin transaction
3173
+ ----------------------------------------------------------------
3174
+ BulkInsertWorkerTest: test_explicit_nil_should_override_defaults
3175
+ ----------------------------------------------------------------
3176
+  (0.1ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',20,'f','2017-02-11 23:45:39.568535','2017-02-11 23:45:39.568535',NULL)
3177
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
3178
+  (0.2ms) rollback transaction
3179
+  (0.1ms) begin transaction
3180
+ -------------------------------------------
3181
+ BulkInsertWorkerTest: test_default_set_size
3182
+ -------------------------------------------
3183
+  (0.0ms) rollback transaction
3184
+  (0.0ms) begin transaction
3185
+ ----------------------------------------------------------------
3186
+ BulkInsertWorkerTest: test_add_should_allow_values_given_as_Hash
3187
+ ----------------------------------------------------------------
3188
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',20,'f','2017-02-11 23:45:39.570261','2017-02-11 23:45:39.570261','chartreuse')
3189
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
3190
+  (0.3ms) rollback transaction
3191
+  (0.0ms) begin transaction
3192
+ --------------------------------------------------------------------
3193
+ BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
3194
+ --------------------------------------------------------------------
3195
+  (0.0ms) rollback transaction
3196
+  (0.0ms) begin transaction
3197
+ ---------------------------------------------------------
3198
+ BulkInsertWorkerTest: test_save!_makes_insert_not_pending
3199
+ ---------------------------------------------------------
3200
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-02-11 23:45:39.572142','2017-02-11 23:45:39.572142','chartreuse')
3201
+  (0.3ms) rollback transaction
3202
+  (0.0ms) begin transaction
3203
+ ------------------------------------------------------
3204
+ BulkInsertWorkerTest: test_empty_insert_is_not_pending
3205
+ ------------------------------------------------------
3206
+  (0.0ms) rollback transaction
3207
+  (0.0ms) begin transaction
3208
+ ---------------------------------------------------------------------
3209
+ BulkInsertWorkerTest: test_add_all_should_append_all_items_to_the_set
3210
+ ---------------------------------------------------------------------
3211
+  (0.0ms) rollback transaction
3212
+  (0.0ms) begin transaction
3213
+ --------------------------------------------------------------
3214
+ BulkInsertWorkerTest: test_after_save_stores_a_block_as_a_proc
3215
+ --------------------------------------------------------------
3216
+  (0.0ms) rollback transaction
3217
+  (0.0ms) begin transaction
3218
+ ------------------------------------------------------------------------------
3219
+ BulkInsertTest: test_default_bulk_columns_should_return_all_columns_without_id
3220
+ ------------------------------------------------------------------------------
3221
+  (0.0ms) rollback transaction
3222
+  (0.0ms) begin transaction
3223
+ -------------------------------------------------------------------
3224
+ BulkInsertTest: test_bulk_insert_without_block_should_return_worker
3225
+ -------------------------------------------------------------------
3226
+  (0.0ms) rollback transaction
3227
+  (0.0ms) begin transaction
3228
+ -----------------------------------------------------------------------------
3229
+ BulkInsertTest: test_bulk_insert_with_array_should_save_the_array_immediately
3230
+ -----------------------------------------------------------------------------
3231
+  (0.1ms) SELECT COUNT(*) FROM "testings"
3232
+  (0.0ms) SAVEPOINT active_record_1
3233
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','green','2017-02-11 23:45:39.576083','chartreuse'),('Hey',20,'f','2017-02-11 23:45:39.576083','2017-02-11 23:45:39.576083','chartreuse')
3234
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3235
+  (0.0ms) SELECT COUNT(*) FROM "testings"
3236
+  (0.3ms) rollback transaction
3237
+  (0.0ms) begin transaction
3238
+ ---------------------------------------------------------------------
3239
+ BulkInsertTest: test_bulk_insert_with_block_should_save_automatically
3240
+ ---------------------------------------------------------------------
3241
+  (0.1ms) SELECT COUNT(*) FROM "testings"
3242
+  (0.0ms) SAVEPOINT active_record_1
3243
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',NULL,NULL,'2017-02-11 23:45:39.578091','2017-02-11 23:45:39.578091','chartreuse')
3244
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3245
+  (0.0ms) SELECT COUNT(*) FROM "testings"
3246
+  (0.2ms) rollback transaction
3247
+  (0.0ms) begin transaction
3248
+ ---------------------------------------------------------------
3249
+ BulkInsertTest: test_bulk_insert_with_block_should_yield_worker
3250
+ ---------------------------------------------------------------
3251
+  (0.0ms) SAVEPOINT active_record_1
3252
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3253
+  (0.0ms) rollback transaction
3254
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
3255
+  (0.1ms) begin transaction
3256
+ -------------------------------------------------------------------
3257
+ BulkInsertWorkerTest: test_after_save_callback_can_be_set_as_a_proc
3258
+ -------------------------------------------------------------------
3259
+  (0.0ms) rollback transaction
3260
+  (0.0ms) begin transaction
3261
+ -------------------------------------------------------------------
3262
+ BulkInsertWorkerTest: test_save!_when_not_pending_should_do_nothing
3263
+ -------------------------------------------------------------------
3264
+  (0.1ms) SELECT COUNT(*) FROM "testings"
3265
+  (0.0ms) SELECT COUNT(*) FROM "testings"
3266
+  (0.0ms) rollback transaction
3267
+  (0.0ms) begin transaction
3268
+ ---------------------------------------------------------------------
3269
+ BulkInsertWorkerTest: test_add_all_should_append_all_items_to_the_set
3270
+ ---------------------------------------------------------------------
3271
+  (0.0ms) rollback transaction
3272
+  (0.0ms) begin transaction
3273
+ --------------------------------------------------------------
3274
+ BulkInsertWorkerTest: test_after_save_stores_a_block_as_a_proc
3275
+ --------------------------------------------------------------
3276
+  (0.0ms) rollback transaction
3277
+  (0.0ms) begin transaction
3278
+ -------------------------------------------------------------
3279
+ BulkInsertWorkerTest: test_save!_calls_the_after_save_handler
3280
+ -------------------------------------------------------------
3281
+  (0.4ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',15,'f','2017-02-11 23:46:25.196788','2017-02-11 23:46:25.196788','chartreuse'),('Hello',25,'t','2017-02-11 23:46:25.196788','2017-02-11 23:46:25.196788','chartreuse')
3282
+  (2.3ms) rollback transaction
3283
+  (0.1ms) begin transaction
3284
+ -------------------------------------------------------------------------------
3285
+ BulkInsertWorkerTest: test_add_should_default_timestamp_columns_to_current_time
3286
+ -------------------------------------------------------------------------------
3287
+  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-02-11 23:46:25.201773','2017-02-11 23:46:25.201773','chartreuse')
3288
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
3289
+  (0.5ms) rollback transaction
3290
+  (0.0ms) begin transaction
3291
+ ------------------------------------------------------
3292
+ BulkInsertWorkerTest: test_empty_insert_is_not_pending
3293
+ ------------------------------------------------------
3294
+  (0.0ms) rollback transaction
3295
+  (0.0ms) begin transaction
3296
+ ------------------------------------------------------------------------------
3297
+ BulkInsertWorkerTest: test_add_should_use_database_default_values_when_present
3298
+ ------------------------------------------------------------------------------
3299
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',20,'f','2017-02-11 23:46:25.209628','2017-02-11 23:46:25.209628','chartreuse')
3300
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
3301
+  (0.3ms) rollback transaction
3302
+  (0.0ms) begin transaction
3303
+ --------------------------------------------------------
3304
+ BulkInsertWorkerTest: test_save!_inserts_pending_records
3305
+ --------------------------------------------------------
3306
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',15,'f','2017-02-11 23:46:25.211213','2017-02-11 23:46:25.211213','chartreuse'),('Hello',25,'t','2017-02-11 23:46:25.211213','2017-02-11 23:46:25.211213','chartreuse')
3307
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
3308
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
3309
+  (0.3ms) rollback transaction
3310
+  (0.0ms) begin transaction
3311
+ ----------------------------------------------------------------
3312
+ BulkInsertWorkerTest: test_add_should_allow_values_given_as_Hash
3313
+ ----------------------------------------------------------------
3314
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',20,'f','2017-02-11 23:46:25.215328','2017-02-11 23:46:25.215328','chartreuse')
3315
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
3316
+  (0.3ms) rollback transaction
3317
+  (0.1ms) begin transaction
3318
+ ----------------------------------------------------------------
3319
+ BulkInsertWorkerTest: test_explicit_nil_should_override_defaults
3320
+ ----------------------------------------------------------------
3321
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',20,'f','2017-02-11 23:46:25.216675','2017-02-11 23:46:25.216675',NULL)
3322
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
3323
+  (0.3ms) rollback transaction
3324
+  (0.0ms) begin transaction
3325
+ ----------------------------------------------------------------------------------
3326
+ BulkInsertWorkerTest: test_add_should_save_automatically_when_overflowing_set_size
3327
+ ----------------------------------------------------------------------------------
3328
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-02-11 23:46:25.217847','2017-02-11 23:46:25.217847','chartreuse')
3329
+  (0.1ms) SELECT COUNT(*) FROM "testings"
3330
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
3331
+  (0.3ms) rollback transaction
3332
+  (0.0ms) begin transaction
3333
+ --------------------------------------------------------------------
3334
+ BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
3335
+ --------------------------------------------------------------------
3336
+  (0.0ms) rollback transaction
3337
+  (0.1ms) begin transaction
3338
+ ----------------------------------------------------------------------------
3339
+ BulkInsertWorkerTest: test_pending_count_should_describe_size_of_pending_set
3340
+ ----------------------------------------------------------------------------
3341
+  (0.1ms) rollback transaction
3342
+  (0.0ms) begin transaction
3343
+ -------------------------------------------
3344
+ BulkInsertWorkerTest: test_default_set_size
3345
+ -------------------------------------------
3346
+  (0.0ms) rollback transaction
3347
+  (0.0ms) begin transaction
3348
+ ----------------------------------------------------------------------------------------------
3349
+ BulkInsertWorkerTest: test_default_timestamp_columns_should_be_equivalent_for_the_entire_batch
3350
+ ----------------------------------------------------------------------------------------------
3351
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-02-11 23:46:25.220829','2017-02-11 23:46:25.220829','chartreuse'),('Howdy',20,'f','2017-02-11 23:46:25.220829','2017-02-11 23:46:25.220829','chartreuse')
3352
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings"
3353
+  (0.3ms) rollback transaction
3354
+  (0.0ms) begin transaction
3355
+ ---------------------------------------------------------
3356
+ BulkInsertWorkerTest: test_save!_makes_insert_not_pending
3357
+ ---------------------------------------------------------
3358
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-02-11 23:46:25.222350','2017-02-11 23:46:25.222350','chartreuse')
3359
+  (0.3ms) rollback transaction
3360
+  (0.0ms) begin transaction
3361
+ ------------------------------------------------------------------------------
3362
+ BulkInsertTest: test_default_bulk_columns_should_return_all_columns_without_id
3363
+ ------------------------------------------------------------------------------
3364
+  (0.0ms) rollback transaction
3365
+  (0.1ms) begin transaction
3366
+ -------------------------------------------------------------------
3367
+ BulkInsertTest: test_bulk_insert_without_block_should_return_worker
3368
+ -------------------------------------------------------------------
3369
+  (0.0ms) rollback transaction
3370
+  (0.0ms) begin transaction
3371
+ -----------------------------------------------------------------------------
3372
+ BulkInsertTest: test_bulk_insert_with_array_should_save_the_array_immediately
3373
+ -----------------------------------------------------------------------------
3374
+  (0.1ms) SELECT COUNT(*) FROM "testings"
3375
+  (0.0ms) SAVEPOINT active_record_1
3376
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','green','2017-02-11 23:46:25.224910','chartreuse'),('Hey',20,'f','2017-02-11 23:46:25.224910','2017-02-11 23:46:25.224910','chartreuse')
3377
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3378
+  (0.0ms) SELECT COUNT(*) FROM "testings"
3379
+  (0.3ms) rollback transaction
3380
+  (0.0ms) begin transaction
3381
+ ---------------------------------------------------------------
3382
+ BulkInsertTest: test_bulk_insert_with_block_should_yield_worker
3383
+ ---------------------------------------------------------------
3384
+  (0.1ms) SAVEPOINT active_record_1
3385
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3386
+  (0.0ms) rollback transaction
3387
+  (0.0ms) begin transaction
3388
+ ---------------------------------------------------------------------
3389
+ BulkInsertTest: test_bulk_insert_with_block_should_save_automatically
3390
+ ---------------------------------------------------------------------
3391
+  (0.1ms) SELECT COUNT(*) FROM "testings"
3392
+  (0.0ms) SAVEPOINT active_record_1
3393
+  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',NULL,NULL,'2017-02-11 23:46:25.227624','2017-02-11 23:46:25.227624','chartreuse')
3394
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3395
+  (0.0ms) SELECT COUNT(*) FROM "testings"
3396
+  (0.3ms) rollback transaction
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bulk_insert
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jamis Buck
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-01 00:00:00.000000000 Z
11
+ date: 2017-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord