bulk_insert 1.4.0 → 1.5.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: 441f604c7dcfaa00902f46fca07f376559fed7ce
4
- data.tar.gz: 9a00313cc43ed9aa6fb704e9b0ba600015b10599
3
+ metadata.gz: daeb75000c0960a475cd101c0e5f631ed67cc254
4
+ data.tar.gz: 0f7bb5595ee7bbc9c259beb1f65a88c5497470ff
5
5
  SHA512:
6
- metadata.gz: e8b779e68d0f0ab4fcaf9699e38ce2a56962c95edaf615d0952713e28b6d0e95ef0ffe42da46101b5b4bcbba8b8e334d7ac259f7c903770c33b30fefcab67e90
7
- data.tar.gz: c37eaf99e2ec09a9b1b9328eca84274130677b3ed6cf5a23b91abd358ef8fbff83b1cd6101481a783af2dd9542b0a5cdd4956fe6375b2f720c711ad5a5512733
6
+ metadata.gz: 6d0bdabab8912f6245403cc420f0f5c5c3d7dc5f8fd922bc0bbb3be057d02fbb58d122c24d1a27a818737280dd6291b350dacdf8719fddd229beee9470ce3e54
7
+ data.tar.gz: 1d8334c2676c67d3177aa764409851335288b690bc31362ee20219aac1547c91b39d37f7ecccae82f5ae03740b0885c684f065a08625ced795483793b1daf285
data/Rakefile CHANGED
@@ -14,11 +14,6 @@ RDoc::Task.new(:rdoc) do |rdoc|
14
14
  rdoc.rdoc_files.include('lib/**/*.rb')
15
15
  end
16
16
 
17
-
18
-
19
-
20
-
21
-
22
17
  Bundler::GemHelper.install_tasks
23
18
 
24
19
  require 'rake/testtask'
@@ -1,6 +1,6 @@
1
1
  module BulkInsert
2
2
  MAJOR = 1
3
- MINOR = 4
3
+ MINOR = 5
4
4
  TINY = 0
5
5
 
6
6
  VERSION = [MAJOR, MINOR, TINY].join(".")
@@ -2,13 +2,18 @@ module BulkInsert
2
2
  class Worker
3
3
  attr_reader :connection
4
4
  attr_accessor :set_size
5
+ attr_accessor :before_save_callback
5
6
  attr_accessor :after_save_callback
7
+ attr_accessor :adapter_name
8
+ attr_reader :ignore
6
9
 
7
10
  def initialize(connection, table_name, column_names, set_size=500, ignore=false)
8
11
  @connection = connection
9
12
  @set_size = set_size
13
+
14
+ @adapter_name = connection.adapter_name
10
15
  # INSERT IGNORE only fails inserts with duplicate keys or unallowed nulls not the whole set of inserts
11
- @ignore = ignore ? "IGNORE" : nil
16
+ @ignore = ignore
12
17
 
13
18
  columns = connection.columns(table_name)
14
19
  column_map = columns.inject({}) { |h, c| h.update(c.name => c) }
@@ -17,6 +22,7 @@ module BulkInsert
17
22
  @table_name = connection.quote_table_name(table_name)
18
23
  @column_names = column_names.map { |name| connection.quote_column_name(name) }.join(",")
19
24
 
25
+ @before_save_callback = nil
20
26
  @after_save_callback = nil
21
27
 
22
28
  @set = []
@@ -58,40 +64,70 @@ module BulkInsert
58
64
  self
59
65
  end
60
66
 
67
+ def before_save(&block)
68
+ @before_save_callback = block
69
+ end
70
+
61
71
  def after_save(&block)
62
72
  @after_save_callback = block
63
73
  end
64
74
 
65
75
  def save!
66
76
  if pending?
67
- sql = "INSERT #{@ignore} INTO #{@table_name} (#{@column_names}) VALUES "
68
- @now = Time.now
69
-
70
- rows = []
71
- @set.each do |row|
72
- values = []
73
- @columns.zip(row) do |column, value|
74
- value = @now if value == :__timestamp_placeholder
75
-
76
- if ActiveRecord::VERSION::STRING >= "5.0.0"
77
- value = @connection.type_cast_from_column(column, value) if column
78
- values << @connection.quote(value)
79
- else
80
- values << @connection.quote(value, column)
81
- end
77
+ @before_save_callback.(@set) if @before_save_callback
78
+ compose_insert_query.tap { |query| @connection.execute(query) if query }
79
+ @after_save_callback.() if @after_save_callback
80
+ @set.clear
81
+ end
82
+
83
+ self
84
+ end
85
+
86
+ def compose_insert_query
87
+ sql = insert_sql_statement
88
+ @now = Time.now
89
+ rows = []
90
+
91
+ @set.each do |row|
92
+ values = []
93
+ @columns.zip(row) do |column, value|
94
+ value = @now if value == :__timestamp_placeholder
95
+
96
+ if ActiveRecord::VERSION::STRING >= "5.0.0"
97
+ value = @connection.type_cast_from_column(column, value) if column
98
+ values << @connection.quote(value)
99
+ else
100
+ values << @connection.quote(value, column)
82
101
  end
83
- rows << "(#{values.join(',')})"
84
102
  end
103
+ rows << "(#{values.join(',')})"
104
+ end
85
105
 
106
+ if !rows.empty?
86
107
  sql << rows.join(",")
87
- @connection.execute(sql)
88
-
89
- @after_save_callback.() if @after_save_callback
108
+ sql << on_conflict_statement
109
+ sql
110
+ else
111
+ false
112
+ end
113
+ end
90
114
 
91
- @set.clear
115
+ def insert_sql_statement
116
+ insert_ignore = if ignore
117
+ if adapter_name == "MySQL"
118
+ 'IGNORE'
119
+ elsif adapter_name.match(/sqlite.*/i)
120
+ 'OR IGNORE'
121
+ else
122
+ '' # Not supported
123
+ end
92
124
  end
93
125
 
94
- self
126
+ "INSERT #{insert_ignore} INTO #{@table_name} (#{@column_names}) VALUES "
127
+ end
128
+
129
+ def on_conflict_statement
130
+ (adapter_name == 'PostgreSQL' && ignore ) ? ' ON CONFLICT DO NOTHING' : ''
95
131
  end
96
132
  end
97
133
  end
@@ -150,5 +150,132 @@ class BulkInsertWorkerTest < ActiveSupport::TestCase
150
150
 
151
151
  assert_equal "hello", @insert.after_save_callback.()
152
152
  end
153
- end
154
153
 
154
+ test "save! calls the before_save handler" do
155
+ x = 41
156
+
157
+ @insert.before_save do
158
+ x += 1
159
+ end
160
+
161
+ @insert.add ["Yo", 15, false, @now, @now]
162
+ @insert.add ["Hello", 25, true, @now, @now]
163
+ @insert.save!
164
+
165
+ assert_equal 42, x
166
+ end
167
+
168
+ test "before_save stores a block as a proc" do
169
+ @insert.before_save do
170
+ "hello"
171
+ end
172
+
173
+ assert_equal "hello", @insert.before_save_callback.()
174
+ end
175
+
176
+ test "before_save_callback can be set as a proc" do
177
+ @insert.before_save_callback = -> do
178
+ "hello"
179
+ end
180
+
181
+ assert_equal "hello", @insert.before_save_callback.()
182
+ end
183
+
184
+ test "before_save can manipulate the set" do
185
+ @insert.before_save do |set|
186
+ set.reject!{|row| row[0] == "Yo"}
187
+ end
188
+
189
+ @insert.add ["Yo", 15, false, @now, @now]
190
+ @insert.add ["Hello", 25, true, @now, @now]
191
+ @insert.save!
192
+
193
+ yo = Testing.find_by(greeting: 'Yo')
194
+ hello = Testing.find_by(greeting: 'Hello')
195
+
196
+ assert_nil yo
197
+ assert_not_nil hello
198
+ end
199
+
200
+ test "save! doesn't blow up if before_save emptying the set" do
201
+ @insert.before_save do |set|
202
+ set.clear
203
+ end
204
+
205
+ @insert.add ["Yo", 15, false, @now, @now]
206
+ @insert.add ["Hello", 25, true, @now, @now]
207
+ @insert.save!
208
+
209
+ yo = Testing.find_by(greeting: 'Yo')
210
+ hello = Testing.find_by(greeting: 'Hello')
211
+
212
+ assert_nil yo
213
+ assert_nil hello
214
+ end
215
+
216
+ test "adapter dependent default methods" do
217
+ assert_equal @insert.adapter_name, 'SQLite'
218
+ assert_equal @insert.insert_sql_statement, "INSERT INTO \"testings\" (\"greeting\",\"age\",\"happy\",\"created_at\",\"updated_at\",\"color\") VALUES "
219
+
220
+ @insert.add ["Yo", 15, false, nil, nil]
221
+ assert_equal @insert.compose_insert_query, "INSERT INTO \"testings\" (\"greeting\",\"age\",\"happy\",\"created_at\",\"updated_at\",\"color\") VALUES ('Yo',15,'f',NULL,NULL,'chartreuse')"
222
+ end
223
+
224
+ test "adapter dependent mysql methods" do
225
+ mysql_worker = BulkInsert::Worker.new(
226
+ Testing.connection,
227
+ Testing.table_name,
228
+ %w(greeting age happy created_at updated_at color),
229
+ 500, # batch size
230
+ true) # ignore
231
+ mysql_worker.adapter_name = 'MySQL'
232
+
233
+ assert_equal mysql_worker.adapter_name, 'MySQL'
234
+ assert_equal (mysql_worker.adapter_name == 'MySQL'), true
235
+ assert_equal mysql_worker.ignore, true
236
+ assert_equal ((mysql_worker.adapter_name == 'MySQL') & mysql_worker.ignore), true
237
+
238
+ mysql_worker.add ["Yo", 15, false, nil, nil]
239
+
240
+ assert_equal mysql_worker.compose_insert_query, "INSERT IGNORE INTO \"testings\" (\"greeting\",\"age\",\"happy\",\"created_at\",\"updated_at\",\"color\") VALUES ('Yo',15,'f',NULL,NULL,'chartreuse')"
241
+ end
242
+
243
+ test "adapter dependent postgresql methods" do
244
+ pgsql_worker = BulkInsert::Worker.new(
245
+ Testing.connection,
246
+ Testing.table_name,
247
+ %w(greeting age happy created_at updated_at color),
248
+ 500, # batch size
249
+ true) # ignore
250
+ pgsql_worker.adapter_name = 'PostgreSQL'
251
+ pgsql_worker.add ["Yo", 15, false, nil, nil]
252
+
253
+ assert_equal pgsql_worker.compose_insert_query, "INSERT INTO \"testings\" (\"greeting\",\"age\",\"happy\",\"created_at\",\"updated_at\",\"color\") VALUES ('Yo',15,'f',NULL,NULL,'chartreuse') ON CONFLICT DO NOTHING"
254
+ end
255
+
256
+ test "adapter dependent sqlite3 methods (with lowercase adapter name)" do
257
+ sqlite_worker = BulkInsert::Worker.new(
258
+ Testing.connection,
259
+ Testing.table_name,
260
+ %w(greeting age happy created_at updated_at color),
261
+ 500, # batch size
262
+ true) # ignore
263
+ sqlite_worker.adapter_name = 'sqlite3'
264
+ sqlite_worker.add ["Yo", 15, false, nil, nil]
265
+
266
+ assert_equal sqlite_worker.compose_insert_query, "INSERT OR IGNORE INTO \"testings\" (\"greeting\",\"age\",\"happy\",\"created_at\",\"updated_at\",\"color\") VALUES ('Yo',15,'f',NULL,NULL,'chartreuse')"
267
+ end
268
+
269
+ test "adapter dependent sqlite3 methods (with stylecase adapter name)" do
270
+ sqlite_worker = BulkInsert::Worker.new(
271
+ Testing.connection,
272
+ Testing.table_name,
273
+ %w(greeting age happy created_at updated_at color),
274
+ 500, # batch size
275
+ true) # ignore
276
+ sqlite_worker.adapter_name = 'SQLite'
277
+ sqlite_worker.add ["Yo", 15, false, nil, nil]
278
+
279
+ assert_equal sqlite_worker.compose_insert_query, "INSERT OR IGNORE INTO \"testings\" (\"greeting\",\"age\",\"happy\",\"created_at\",\"updated_at\",\"color\") VALUES ('Yo',15,'f',NULL,NULL,'chartreuse')"
280
+ end
281
+ end
@@ -3394,3 +3394,958 @@ BulkInsertTest: test_bulk_insert_with_block_should_save_automatically
3394
3394
   (0.0ms) RELEASE SAVEPOINT active_record_1
3395
3395
   (0.0ms) SELECT COUNT(*) FROM "testings"
3396
3396
   (0.3ms) rollback transaction
3397
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
3398
+  (0.1ms) begin transaction
3399
+ --------------------------------------------------------
3400
+ BulkInsertWorkerTest: test_save!_inserts_pending_records
3401
+ --------------------------------------------------------
3402
+  (1.0ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',15,'f','2017-03-02 15:37:43.151334','2017-03-02 15:37:43.151334','chartreuse'),('Hello',25,'t','2017-03-02 15:37:43.151334','2017-03-02 15:37:43.151334','chartreuse')
3403
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
3404
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
3405
+  (0.4ms) rollback transaction
3406
+  (0.1ms) begin transaction
3407
+ ---------------------------------------------------------------------
3408
+ BulkInsertWorkerTest: test_add_all_should_append_all_items_to_the_set
3409
+ ---------------------------------------------------------------------
3410
+  (0.0ms) rollback transaction
3411
+  (0.0ms) begin transaction
3412
+ ----------------------------------------------------------------------------------
3413
+ BulkInsertWorkerTest: test_add_should_save_automatically_when_overflowing_set_size
3414
+ ----------------------------------------------------------------------------------
3415
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-03-02 15:37:43.164529','2017-03-02 15:37:43.164529','chartreuse')
3416
+  (0.0ms) SELECT COUNT(*) FROM "testings"
3417
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
3418
+  (0.3ms) rollback transaction
3419
+  (0.1ms) begin transaction
3420
+ --------------------------------------------------------------------
3421
+ BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
3422
+ --------------------------------------------------------------------
3423
+  (0.0ms) rollback transaction
3424
+  (0.0ms) begin transaction
3425
+ -------------------------------------------------------------------
3426
+ BulkInsertWorkerTest: test_after_save_callback_can_be_set_as_a_proc
3427
+ -------------------------------------------------------------------
3428
+  (0.0ms) rollback transaction
3429
+  (0.0ms) begin transaction
3430
+ -------------------------------------------------------------------------------
3431
+ BulkInsertWorkerTest: test_add_should_default_timestamp_columns_to_current_time
3432
+ -------------------------------------------------------------------------------
3433
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-03-02 15:37:43.167619','2017-03-02 15:37:43.167619','chartreuse')
3434
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
3435
+  (0.3ms) rollback transaction
3436
+  (0.0ms) begin transaction
3437
+ ------------------------------------------------------
3438
+ BulkInsertWorkerTest: test_empty_insert_is_not_pending
3439
+ ------------------------------------------------------
3440
+  (0.0ms) rollback transaction
3441
+  (0.0ms) begin transaction
3442
+ ----------------------------------------------------------------------------------------------
3443
+ BulkInsertWorkerTest: test_default_timestamp_columns_should_be_equivalent_for_the_entire_batch
3444
+ ----------------------------------------------------------------------------------------------
3445
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-03-02 15:37:43.169827','2017-03-02 15:37:43.169827','chartreuse'),('Howdy',20,'f','2017-03-02 15:37:43.169827','2017-03-02 15:37:43.169827','chartreuse')
3446
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings"
3447
+  (0.3ms) rollback transaction
3448
+  (0.0ms) begin transaction
3449
+ ----------------------------------------------------------------
3450
+ BulkInsertWorkerTest: test_explicit_nil_should_override_defaults
3451
+ ----------------------------------------------------------------
3452
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',20,'f','2017-03-02 15:37:43.171534','2017-03-02 15:37:43.171534',NULL)
3453
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
3454
+  (0.3ms) rollback transaction
3455
+  (0.0ms) begin transaction
3456
+ --------------------------------------------------------------------------------
3457
+ BulkInsertWorkerTest: test_save!_doesn't_blow_up_if_before_save_emptying_the_set
3458
+ --------------------------------------------------------------------------------
3459
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
3460
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
3461
+  (0.0ms) rollback transaction
3462
+  (0.0ms) begin transaction
3463
+ -------------------------------------------------------------------
3464
+ BulkInsertWorkerTest: test_save!_when_not_pending_should_do_nothing
3465
+ -------------------------------------------------------------------
3466
+  (0.0ms) SELECT COUNT(*) FROM "testings"
3467
+  (0.0ms) SELECT COUNT(*) FROM "testings"
3468
+  (0.0ms) rollback transaction
3469
+  (0.0ms) begin transaction
3470
+ ---------------------------------------------------------
3471
+ BulkInsertWorkerTest: test_save!_makes_insert_not_pending
3472
+ ---------------------------------------------------------
3473
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-03-02 15:37:43.174818','2017-03-02 15:37:43.174818','chartreuse')
3474
+  (0.3ms) rollback transaction
3475
+  (0.0ms) begin transaction
3476
+ -------------------------------------------------------------
3477
+ BulkInsertWorkerTest: test_before_save_can_manipulate_the_set
3478
+ -------------------------------------------------------------
3479
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',25,'t','2017-03-02 15:37:43.175909','2017-03-02 15:37:43.175909','chartreuse')
3480
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
3481
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
3482
+  (0.3ms) rollback transaction
3483
+  (0.0ms) begin transaction
3484
+ ----------------------------------------------------------------------------
3485
+ BulkInsertWorkerTest: test_pending_count_should_describe_size_of_pending_set
3486
+ ----------------------------------------------------------------------------
3487
+  (0.0ms) rollback transaction
3488
+  (0.0ms) begin transaction
3489
+ ------------------------------------------------------------------------------
3490
+ BulkInsertWorkerTest: test_add_should_use_database_default_values_when_present
3491
+ ------------------------------------------------------------------------------
3492
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',20,'f','2017-03-02 15:37:43.177778','2017-03-02 15:37:43.177778','chartreuse')
3493
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
3494
+  (0.3ms) rollback transaction
3495
+  (0.0ms) begin transaction
3496
+ -------------------------------------------------------------
3497
+ BulkInsertWorkerTest: test_save!_calls_the_after_save_handler
3498
+ -------------------------------------------------------------
3499
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',15,'f','2017-03-02 15:37:43.179035','2017-03-02 15:37:43.179035','chartreuse'),('Hello',25,'t','2017-03-02 15:37:43.179035','2017-03-02 15:37:43.179035','chartreuse')
3500
+  (0.3ms) rollback transaction
3501
+  (0.0ms) begin transaction
3502
+ --------------------------------------------------------------
3503
+ BulkInsertWorkerTest: test_after_save_stores_a_block_as_a_proc
3504
+ --------------------------------------------------------------
3505
+  (0.0ms) rollback transaction
3506
+  (0.0ms) begin transaction
3507
+ --------------------------------------------------------------
3508
+ BulkInsertWorkerTest: test_save!_calls_the_before_save_handler
3509
+ --------------------------------------------------------------
3510
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',15,'f','2017-03-02 15:37:43.180536','2017-03-02 15:37:43.180536','chartreuse'),('Hello',25,'t','2017-03-02 15:37:43.180536','2017-03-02 15:37:43.180536','chartreuse')
3511
+  (0.3ms) rollback transaction
3512
+  (0.0ms) begin transaction
3513
+ ----------------------------------------------------------------
3514
+ BulkInsertWorkerTest: test_add_should_allow_values_given_as_Hash
3515
+ ----------------------------------------------------------------
3516
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',20,'f','2017-03-02 15:37:43.181612','2017-03-02 15:37:43.181612','chartreuse')
3517
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
3518
+  (0.2ms) rollback transaction
3519
+  (0.0ms) begin transaction
3520
+ --------------------------------------------------------------------
3521
+ BulkInsertWorkerTest: test_before_save_callback_can_be_set_as_a_proc
3522
+ --------------------------------------------------------------------
3523
+  (0.0ms) rollback transaction
3524
+  (0.0ms) begin transaction
3525
+ -------------------------------------------
3526
+ BulkInsertWorkerTest: test_default_set_size
3527
+ -------------------------------------------
3528
+  (0.0ms) rollback transaction
3529
+  (0.0ms) begin transaction
3530
+ ---------------------------------------------------------------
3531
+ BulkInsertWorkerTest: test_before_save_stores_a_block_as_a_proc
3532
+ ---------------------------------------------------------------
3533
+  (0.0ms) rollback transaction
3534
+  (0.0ms) begin transaction
3535
+ -----------------------------------------------------------------------------
3536
+ BulkInsertTest: test_bulk_insert_with_array_should_save_the_array_immediately
3537
+ -----------------------------------------------------------------------------
3538
+  (0.1ms) SELECT COUNT(*) FROM "testings"
3539
+  (0.0ms) SAVEPOINT active_record_1
3540
+  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','green','2017-03-02 15:37:43.185386','chartreuse'),('Hey',20,'f','2017-03-02 15:37:43.185386','2017-03-02 15:37:43.185386','chartreuse')
3541
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3542
+  (0.0ms) SELECT COUNT(*) FROM "testings"
3543
+  (0.2ms) rollback transaction
3544
+  (0.0ms) begin transaction
3545
+ ---------------------------------------------------------------------
3546
+ BulkInsertTest: test_bulk_insert_with_block_should_save_automatically
3547
+ ---------------------------------------------------------------------
3548
+  (0.1ms) SELECT COUNT(*) FROM "testings"
3549
+  (0.0ms) SAVEPOINT active_record_1
3550
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',NULL,NULL,'2017-03-02 15:37:43.187160','2017-03-02 15:37:43.187160','chartreuse')
3551
+  (0.1ms) RELEASE SAVEPOINT active_record_1
3552
+  (0.0ms) SELECT COUNT(*) FROM "testings"
3553
+  (0.2ms) rollback transaction
3554
+  (0.0ms) begin transaction
3555
+ ------------------------------------------------------------------------------
3556
+ BulkInsertTest: test_default_bulk_columns_should_return_all_columns_without_id
3557
+ ------------------------------------------------------------------------------
3558
+  (0.0ms) rollback transaction
3559
+  (0.0ms) begin transaction
3560
+ ---------------------------------------------------------------
3561
+ BulkInsertTest: test_bulk_insert_with_block_should_yield_worker
3562
+ ---------------------------------------------------------------
3563
+  (0.0ms) SAVEPOINT active_record_1
3564
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3565
+  (0.0ms) rollback transaction
3566
+  (0.0ms) begin transaction
3567
+ -------------------------------------------------------------------
3568
+ BulkInsertTest: test_bulk_insert_without_block_should_return_worker
3569
+ -------------------------------------------------------------------
3570
+  (0.0ms) rollback transaction
3571
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
3572
+  (0.1ms) begin transaction
3573
+ ---------------------------------------------------------------
3574
+ BulkInsertTest: test_bulk_insert_with_block_should_yield_worker
3575
+ ---------------------------------------------------------------
3576
+  (0.0ms) SAVEPOINT active_record_1
3577
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3578
+  (0.1ms) rollback transaction
3579
+  (0.0ms) begin transaction
3580
+ ---------------------------------------------------------------------
3581
+ BulkInsertTest: test_bulk_insert_with_block_should_save_automatically
3582
+ ---------------------------------------------------------------------
3583
+  (0.3ms) SELECT COUNT(*) FROM "testings"
3584
+  (0.0ms) SAVEPOINT active_record_1
3585
+  (0.6ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',NULL,NULL,'2017-03-14 21:14:51.911324','2017-03-14 21:14:51.911324','chartreuse')
3586
+  (0.1ms) RELEASE SAVEPOINT active_record_1
3587
+  (0.0ms) SELECT COUNT(*) FROM "testings"
3588
+  (0.3ms) rollback transaction
3589
+  (0.1ms) begin transaction
3590
+ -------------------------------------------------------------------
3591
+ BulkInsertTest: test_bulk_insert_without_block_should_return_worker
3592
+ -------------------------------------------------------------------
3593
+  (0.0ms) rollback transaction
3594
+  (0.0ms) begin transaction
3595
+ ------------------------------------------------------------------------------
3596
+ BulkInsertTest: test_default_bulk_columns_should_return_all_columns_without_id
3597
+ ------------------------------------------------------------------------------
3598
+  (0.0ms) rollback transaction
3599
+  (0.0ms) begin transaction
3600
+ -----------------------------------------------------------------------------
3601
+ BulkInsertTest: test_bulk_insert_with_array_should_save_the_array_immediately
3602
+ -----------------------------------------------------------------------------
3603
+  (0.0ms) SELECT COUNT(*) FROM "testings"
3604
+  (0.0ms) SAVEPOINT active_record_1
3605
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','green','2017-03-14 21:14:51.915530','chartreuse'),('Hey',20,'f','2017-03-14 21:14:51.915530','2017-03-14 21:14:51.915530','chartreuse')
3606
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3607
+  (0.0ms) SELECT COUNT(*) FROM "testings"
3608
+  (0.3ms) rollback transaction
3609
+  (0.0ms) begin transaction
3610
+ -------------------------------------------------------------------
3611
+ BulkInsertWorkerTest: test_save!_when_not_pending_should_do_nothing
3612
+ -------------------------------------------------------------------
3613
+  (0.0ms) SELECT COUNT(*) FROM "testings"
3614
+  (0.0ms) SELECT COUNT(*) FROM "testings"
3615
+  (0.0ms) rollback transaction
3616
+  (0.0ms) begin transaction
3617
+ -------------------------------------------------------------
3618
+ BulkInsertWorkerTest: test_save!_calls_the_after_save_handler
3619
+ -------------------------------------------------------------
3620
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',15,'f','2017-03-14 21:14:51.919099','2017-03-14 21:14:51.919099','chartreuse'),('Hello',25,'t','2017-03-14 21:14:51.919099','2017-03-14 21:14:51.919099','chartreuse')
3621
+  (0.3ms) rollback transaction
3622
+  (0.0ms) begin transaction
3623
+ ----------------------------------------------------------------------------------------------
3624
+ BulkInsertWorkerTest: test_default_timestamp_columns_should_be_equivalent_for_the_entire_batch
3625
+ ----------------------------------------------------------------------------------------------
3626
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-03-14 21:14:51.920267','2017-03-14 21:14:51.920267','chartreuse'),('Howdy',20,'f','2017-03-14 21:14:51.920267','2017-03-14 21:14:51.920267','chartreuse')
3627
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings"
3628
+  (0.2ms) rollback transaction
3629
+  (0.0ms) begin transaction
3630
+ ----------------------------------------------------------------
3631
+ BulkInsertWorkerTest: test_explicit_nil_should_override_defaults
3632
+ ----------------------------------------------------------------
3633
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',20,'f','2017-03-14 21:14:51.924554','2017-03-14 21:14:51.924554',NULL)
3634
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
3635
+  (0.4ms) rollback transaction
3636
+  (0.0ms) begin transaction
3637
+ ------------------------------------------------------------------------------
3638
+ BulkInsertWorkerTest: test_add_should_use_database_default_values_when_present
3639
+ ------------------------------------------------------------------------------
3640
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',20,'f','2017-03-14 21:14:51.927153','2017-03-14 21:14:51.927153','chartreuse')
3641
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
3642
+  (0.3ms) rollback transaction
3643
+  (0.0ms) begin transaction
3644
+ --------------------------------------------------------------------
3645
+ BulkInsertWorkerTest: test_before_save_callback_can_be_set_as_a_proc
3646
+ --------------------------------------------------------------------
3647
+  (0.0ms) rollback transaction
3648
+  (0.1ms) begin transaction
3649
+ ------------------------------------------------------------
3650
+ BulkInsertWorkerTest: test_adapter_dependent_default_methods
3651
+ ------------------------------------------------------------
3652
+  (0.0ms) rollback transaction
3653
+  (0.0ms) begin transaction
3654
+ --------------------------------------------------------
3655
+ BulkInsertWorkerTest: test_save!_inserts_pending_records
3656
+ --------------------------------------------------------
3657
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',15,'f','2017-03-14 21:14:51.929655','2017-03-14 21:14:51.929655','chartreuse'),('Hello',25,'t','2017-03-14 21:14:51.929655','2017-03-14 21:14:51.929655','chartreuse')
3658
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
3659
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
3660
+  (0.3ms) rollback transaction
3661
+  (0.0ms) begin transaction
3662
+ --------------------------------------------------------------------
3663
+ BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
3664
+ --------------------------------------------------------------------
3665
+  (0.0ms) rollback transaction
3666
+  (0.0ms) begin transaction
3667
+ ----------------------------------------------------------------------------------
3668
+ BulkInsertWorkerTest: test_add_should_save_automatically_when_overflowing_set_size
3669
+ ----------------------------------------------------------------------------------
3670
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-03-14 21:14:51.934966','2017-03-14 21:14:51.934966','chartreuse')
3671
+  (0.0ms) SELECT COUNT(*) FROM "testings"
3672
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
3673
+  (0.3ms) rollback transaction
3674
+  (0.0ms) begin transaction
3675
+ ----------------------------------------------------------
3676
+ BulkInsertWorkerTest: test_adapter_dependent_mysql_methods
3677
+ ----------------------------------------------------------
3678
+  (0.0ms) rollback transaction
3679
+  (0.1ms) begin transaction
3680
+ --------------------------------------------------------------
3681
+ BulkInsertWorkerTest: test_after_save_stores_a_block_as_a_proc
3682
+ --------------------------------------------------------------
3683
+  (0.0ms) rollback transaction
3684
+  (0.0ms) begin transaction
3685
+ -------------------------------------------------------------------
3686
+ BulkInsertWorkerTest: test_after_save_callback_can_be_set_as_a_proc
3687
+ -------------------------------------------------------------------
3688
+  (0.0ms) rollback transaction
3689
+  (0.0ms) begin transaction
3690
+ ---------------------------------------------------------------------
3691
+ BulkInsertWorkerTest: test_add_all_should_append_all_items_to_the_set
3692
+ ---------------------------------------------------------------------
3693
+  (0.0ms) rollback transaction
3694
+  (0.1ms) begin transaction
3695
+ ------------------------------------------------------
3696
+ BulkInsertWorkerTest: test_empty_insert_is_not_pending
3697
+ ------------------------------------------------------
3698
+  (0.0ms) rollback transaction
3699
+  (0.0ms) begin transaction
3700
+ -------------------------------------------------------------
3701
+ BulkInsertWorkerTest: test_before_save_can_manipulate_the_set
3702
+ -------------------------------------------------------------
3703
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',25,'t','2017-03-14 21:14:51.939071','2017-03-14 21:14:51.939071','chartreuse')
3704
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
3705
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
3706
+  (0.3ms) rollback transaction
3707
+  (0.0ms) begin transaction
3708
+ ----------------------------------------------------------------------------
3709
+ BulkInsertWorkerTest: test_pending_count_should_describe_size_of_pending_set
3710
+ ----------------------------------------------------------------------------
3711
+  (0.0ms) rollback transaction
3712
+  (0.0ms) begin transaction
3713
+ ---------------------------------------------------------------
3714
+ BulkInsertWorkerTest: test_before_save_stores_a_block_as_a_proc
3715
+ ---------------------------------------------------------------
3716
+  (0.0ms) rollback transaction
3717
+  (0.0ms) begin transaction
3718
+ --------------------------------------------------------------
3719
+ BulkInsertWorkerTest: test_save!_calls_the_before_save_handler
3720
+ --------------------------------------------------------------
3721
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',15,'f','2017-03-14 21:14:51.941256','2017-03-14 21:14:51.941256','chartreuse'),('Hello',25,'t','2017-03-14 21:14:51.941256','2017-03-14 21:14:51.941256','chartreuse')
3722
+  (0.2ms) rollback transaction
3723
+  (0.0ms) begin transaction
3724
+ -------------------------------------------
3725
+ BulkInsertWorkerTest: test_default_set_size
3726
+ -------------------------------------------
3727
+  (0.0ms) rollback transaction
3728
+  (0.0ms) begin transaction
3729
+ -------------------------------------------------------------------------------
3730
+ BulkInsertWorkerTest: test_add_should_default_timestamp_columns_to_current_time
3731
+ -------------------------------------------------------------------------------
3732
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-03-14 21:14:51.943028','2017-03-14 21:14:51.943028','chartreuse')
3733
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
3734
+  (0.2ms) rollback transaction
3735
+  (0.0ms) begin transaction
3736
+ ---------------------------------------------------------------
3737
+ BulkInsertWorkerTest: test_adapter_dependent_postgresql_methods
3738
+ ---------------------------------------------------------------
3739
+  (0.0ms) rollback transaction
3740
+  (0.1ms) begin transaction
3741
+ ----------------------------------------------------------------
3742
+ BulkInsertWorkerTest: test_add_should_allow_values_given_as_Hash
3743
+ ----------------------------------------------------------------
3744
+  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',20,'f','2017-03-14 21:14:51.945239','2017-03-14 21:14:51.945239','chartreuse')
3745
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
3746
+  (0.2ms) rollback transaction
3747
+  (0.0ms) begin transaction
3748
+ ---------------------------------------------------------
3749
+ BulkInsertWorkerTest: test_save!_makes_insert_not_pending
3750
+ ---------------------------------------------------------
3751
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-03-14 21:14:51.946999','2017-03-14 21:14:51.946999','chartreuse')
3752
+  (0.2ms) rollback transaction
3753
+  (0.0ms) begin transaction
3754
+ --------------------------------------------------------------------------------
3755
+ BulkInsertWorkerTest: test_save!_doesn't_blow_up_if_before_save_emptying_the_set
3756
+ --------------------------------------------------------------------------------
3757
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
3758
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
3759
+  (0.1ms) rollback transaction
3760
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
3761
+  (0.1ms) begin transaction
3762
+ ------------------------------------------------------------------------------
3763
+ BulkInsertTest: test_default_bulk_columns_should_return_all_columns_without_id
3764
+ ------------------------------------------------------------------------------
3765
+  (0.0ms) rollback transaction
3766
+  (0.0ms) begin transaction
3767
+ -------------------------------------------------------------------
3768
+ BulkInsertTest: test_bulk_insert_without_block_should_return_worker
3769
+ -------------------------------------------------------------------
3770
+  (0.0ms) rollback transaction
3771
+  (0.0ms) begin transaction
3772
+ ---------------------------------------------------------------
3773
+ BulkInsertTest: test_bulk_insert_with_block_should_yield_worker
3774
+ ---------------------------------------------------------------
3775
+  (0.0ms) SAVEPOINT active_record_1
3776
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3777
+  (0.0ms) rollback transaction
3778
+  (0.0ms) begin transaction
3779
+ ---------------------------------------------------------------------
3780
+ BulkInsertTest: test_bulk_insert_with_block_should_save_automatically
3781
+ ---------------------------------------------------------------------
3782
+  (0.3ms) SELECT COUNT(*) FROM "testings"
3783
+  (0.0ms) SAVEPOINT active_record_1
3784
+  (0.7ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',NULL,NULL,'2017-03-27 13:28:27.604659','2017-03-27 13:28:27.604659','chartreuse')
3785
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3786
+  (0.0ms) SELECT COUNT(*) FROM "testings"
3787
+  (0.3ms) rollback transaction
3788
+  (0.0ms) begin transaction
3789
+ -----------------------------------------------------------------------------
3790
+ BulkInsertTest: test_bulk_insert_with_array_should_save_the_array_immediately
3791
+ -----------------------------------------------------------------------------
3792
+  (0.1ms) SELECT COUNT(*) FROM "testings"
3793
+  (0.0ms) SAVEPOINT active_record_1
3794
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','green','2017-03-27 13:28:27.608609','chartreuse'),('Hey',20,'f','2017-03-27 13:28:27.608609','2017-03-27 13:28:27.608609','chartreuse')
3795
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3796
+  (0.0ms) SELECT COUNT(*) FROM "testings"
3797
+  (0.3ms) rollback transaction
3798
+  (0.0ms) begin transaction
3799
+ -------------------------------------------------------------------
3800
+ BulkInsertWorkerTest: test_after_save_callback_can_be_set_as_a_proc
3801
+ -------------------------------------------------------------------
3802
+  (0.0ms) rollback transaction
3803
+  (0.0ms) begin transaction
3804
+ -------------------------------------------------------------
3805
+ BulkInsertWorkerTest: test_save!_calls_the_after_save_handler
3806
+ -------------------------------------------------------------
3807
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',15,'f','2017-03-27 13:28:27.611070','2017-03-27 13:28:27.611070','chartreuse'),('Hello',25,'t','2017-03-27 13:28:27.611070','2017-03-27 13:28:27.611070','chartreuse')
3808
+  (0.3ms) rollback transaction
3809
+  (0.0ms) begin transaction
3810
+ ----------------------------------------------------------------------------------
3811
+ BulkInsertWorkerTest: test_add_should_save_automatically_when_overflowing_set_size
3812
+ ----------------------------------------------------------------------------------
3813
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-03-27 13:28:27.612581','2017-03-27 13:28:27.612581','chartreuse')
3814
+  (0.0ms) SELECT COUNT(*) FROM "testings"
3815
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
3816
+  (0.3ms) rollback transaction
3817
+  (0.0ms) begin transaction
3818
+ --------------------------------------------------------------------
3819
+ BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
3820
+ --------------------------------------------------------------------
3821
+  (0.0ms) rollback transaction
3822
+  (0.0ms) begin transaction
3823
+ ----------------------------------------------------------
3824
+ BulkInsertWorkerTest: test_adapter_dependent_mysql_methods
3825
+ ----------------------------------------------------------
3826
+  (0.0ms) rollback transaction
3827
+  (0.0ms) begin transaction
3828
+ --------------------------------------------------------------------
3829
+ BulkInsertWorkerTest: test_before_save_callback_can_be_set_as_a_proc
3830
+ --------------------------------------------------------------------
3831
+  (0.0ms) rollback transaction
3832
+  (0.0ms) begin transaction
3833
+ ---------------------------------------------------------
3834
+ BulkInsertWorkerTest: test_save!_makes_insert_not_pending
3835
+ ---------------------------------------------------------
3836
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-03-27 13:28:27.619587','2017-03-27 13:28:27.619587','chartreuse')
3837
+  (0.3ms) rollback transaction
3838
+  (0.1ms) begin transaction
3839
+ ------------------------------------------------------------
3840
+ BulkInsertWorkerTest: test_adapter_dependent_sqlite3_methods
3841
+ ------------------------------------------------------------
3842
+  (0.0ms) rollback transaction
3843
+  (0.0ms) begin transaction
3844
+ ------------------------------------------------------------------------------
3845
+ BulkInsertWorkerTest: test_add_should_use_database_default_values_when_present
3846
+ ------------------------------------------------------------------------------
3847
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',20,'f','2017-03-27 13:28:27.621256','2017-03-27 13:28:27.621256','chartreuse')
3848
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
3849
+  (0.3ms) rollback transaction
3850
+  (0.0ms) begin transaction
3851
+ ----------------------------------------------------------------------------------------------
3852
+ BulkInsertWorkerTest: test_default_timestamp_columns_should_be_equivalent_for_the_entire_batch
3853
+ ----------------------------------------------------------------------------------------------
3854
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-03-27 13:28:27.622577','2017-03-27 13:28:27.622577','chartreuse'),('Howdy',20,'f','2017-03-27 13:28:27.622577','2017-03-27 13:28:27.622577','chartreuse')
3855
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings"
3856
+  (0.3ms) rollback transaction
3857
+  (0.0ms) begin transaction
3858
+ ----------------------------------------------------------------
3859
+ BulkInsertWorkerTest: test_explicit_nil_should_override_defaults
3860
+ ----------------------------------------------------------------
3861
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',20,'f','2017-03-27 13:28:27.624018','2017-03-27 13:28:27.624018',NULL)
3862
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
3863
+  (0.3ms) rollback transaction
3864
+  (0.0ms) begin transaction
3865
+ ------------------------------------------------------
3866
+ BulkInsertWorkerTest: test_empty_insert_is_not_pending
3867
+ ------------------------------------------------------
3868
+  (0.0ms) rollback transaction
3869
+  (0.0ms) begin transaction
3870
+ -------------------------------------------------------------------
3871
+ BulkInsertWorkerTest: test_save!_when_not_pending_should_do_nothing
3872
+ -------------------------------------------------------------------
3873
+  (0.0ms) SELECT COUNT(*) FROM "testings"
3874
+  (0.0ms) SELECT COUNT(*) FROM "testings"
3875
+  (0.0ms) rollback transaction
3876
+  (0.0ms) begin transaction
3877
+ ------------------------------------------------------------
3878
+ BulkInsertWorkerTest: test_adapter_dependent_default_methods
3879
+ ------------------------------------------------------------
3880
+  (0.0ms) rollback transaction
3881
+  (0.0ms) begin transaction
3882
+ --------------------------------------------------------------
3883
+ BulkInsertWorkerTest: test_save!_calls_the_before_save_handler
3884
+ --------------------------------------------------------------
3885
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',15,'f','2017-03-27 13:28:27.627053','2017-03-27 13:28:27.627053','chartreuse'),('Hello',25,'t','2017-03-27 13:28:27.627053','2017-03-27 13:28:27.627053','chartreuse')
3886
+  (0.3ms) rollback transaction
3887
+  (0.1ms) begin transaction
3888
+ ----------------------------------------------------------------------------
3889
+ BulkInsertWorkerTest: test_pending_count_should_describe_size_of_pending_set
3890
+ ----------------------------------------------------------------------------
3891
+  (0.1ms) rollback transaction
3892
+  (0.0ms) begin transaction
3893
+ ---------------------------------------------------------------
3894
+ BulkInsertWorkerTest: test_adapter_dependent_postgresql_methods
3895
+ ---------------------------------------------------------------
3896
+  (0.0ms) rollback transaction
3897
+  (0.0ms) begin transaction
3898
+ --------------------------------------------------------
3899
+ BulkInsertWorkerTest: test_save!_inserts_pending_records
3900
+ --------------------------------------------------------
3901
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',15,'f','2017-03-27 13:28:27.629216','2017-03-27 13:28:27.629216','chartreuse'),('Hello',25,'t','2017-03-27 13:28:27.629216','2017-03-27 13:28:27.629216','chartreuse')
3902
+ Testing Load (0.2ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
3903
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
3904
+  (0.3ms) rollback transaction
3905
+  (0.0ms) begin transaction
3906
+ -------------------------------------------------------------------------------
3907
+ BulkInsertWorkerTest: test_add_should_default_timestamp_columns_to_current_time
3908
+ -------------------------------------------------------------------------------
3909
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-03-27 13:28:27.635378','2017-03-27 13:28:27.635378','chartreuse')
3910
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
3911
+  (0.2ms) rollback transaction
3912
+  (0.0ms) begin transaction
3913
+ -------------------------------------------
3914
+ BulkInsertWorkerTest: test_default_set_size
3915
+ -------------------------------------------
3916
+  (0.0ms) rollback transaction
3917
+  (0.0ms) begin transaction
3918
+ ---------------------------------------------------------------
3919
+ BulkInsertWorkerTest: test_before_save_stores_a_block_as_a_proc
3920
+ ---------------------------------------------------------------
3921
+  (0.0ms) rollback transaction
3922
+  (0.0ms) begin transaction
3923
+ ---------------------------------------------------------------------
3924
+ BulkInsertWorkerTest: test_add_all_should_append_all_items_to_the_set
3925
+ ---------------------------------------------------------------------
3926
+  (0.0ms) rollback transaction
3927
+  (0.0ms) begin transaction
3928
+ --------------------------------------------------------------------------------
3929
+ BulkInsertWorkerTest: test_save!_doesn't_blow_up_if_before_save_emptying_the_set
3930
+ --------------------------------------------------------------------------------
3931
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
3932
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
3933
+  (0.0ms) rollback transaction
3934
+  (0.0ms) begin transaction
3935
+ ----------------------------------------------------------------
3936
+ BulkInsertWorkerTest: test_add_should_allow_values_given_as_Hash
3937
+ ----------------------------------------------------------------
3938
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',20,'f','2017-03-27 13:28:27.638853','2017-03-27 13:28:27.638853','chartreuse')
3939
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
3940
+  (0.2ms) rollback transaction
3941
+  (0.0ms) begin transaction
3942
+ --------------------------------------------------------------
3943
+ BulkInsertWorkerTest: test_after_save_stores_a_block_as_a_proc
3944
+ --------------------------------------------------------------
3945
+  (0.0ms) rollback transaction
3946
+  (0.0ms) begin transaction
3947
+ -------------------------------------------------------------
3948
+ BulkInsertWorkerTest: test_before_save_can_manipulate_the_set
3949
+ -------------------------------------------------------------
3950
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',25,'t','2017-03-27 13:28:27.640755','2017-03-27 13:28:27.640755','chartreuse')
3951
+ Testing Load (0.4ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
3952
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
3953
+  (0.3ms) rollback transaction
3954
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
3955
+  (0.1ms) begin transaction
3956
+ -------------------------------------------------------------------
3957
+ BulkInsertTest: test_bulk_insert_without_block_should_return_worker
3958
+ -------------------------------------------------------------------
3959
+  (0.0ms) rollback transaction
3960
+  (0.1ms) begin transaction
3961
+ ---------------------------------------------------------------
3962
+ BulkInsertTest: test_bulk_insert_with_block_should_yield_worker
3963
+ ---------------------------------------------------------------
3964
+  (0.0ms) SAVEPOINT active_record_1
3965
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3966
+  (0.0ms) rollback transaction
3967
+  (0.0ms) begin transaction
3968
+ ---------------------------------------------------------------------
3969
+ BulkInsertTest: test_bulk_insert_with_block_should_save_automatically
3970
+ ---------------------------------------------------------------------
3971
+  (0.4ms) SELECT COUNT(*) FROM "testings"
3972
+  (0.0ms) SAVEPOINT active_record_1
3973
+  (0.6ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',NULL,NULL,'2017-03-27 20:26:52.646571','2017-03-27 20:26:52.646571','chartreuse')
3974
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3975
+  (0.0ms) SELECT COUNT(*) FROM "testings"
3976
+  (0.3ms) rollback transaction
3977
+  (0.0ms) begin transaction
3978
+ -----------------------------------------------------------------------------
3979
+ BulkInsertTest: test_bulk_insert_with_array_should_save_the_array_immediately
3980
+ -----------------------------------------------------------------------------
3981
+  (0.1ms) SELECT COUNT(*) FROM "testings"
3982
+  (0.0ms) SAVEPOINT active_record_1
3983
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','green','2017-03-27 20:26:52.650754','chartreuse'),('Hey',20,'f','2017-03-27 20:26:52.650754','2017-03-27 20:26:52.650754','chartreuse')
3984
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3985
+  (0.0ms) SELECT COUNT(*) FROM "testings"
3986
+  (0.3ms) rollback transaction
3987
+  (0.0ms) begin transaction
3988
+ ------------------------------------------------------------------------------
3989
+ BulkInsertTest: test_default_bulk_columns_should_return_all_columns_without_id
3990
+ ------------------------------------------------------------------------------
3991
+  (0.0ms) rollback transaction
3992
+  (0.0ms) begin transaction
3993
+ -------------------------------------------------------------------
3994
+ BulkInsertWorkerTest: test_save!_when_not_pending_should_do_nothing
3995
+ -------------------------------------------------------------------
3996
+  (0.0ms) SELECT COUNT(*) FROM "testings"
3997
+  (0.0ms) SELECT COUNT(*) FROM "testings"
3998
+  (0.0ms) rollback transaction
3999
+  (0.0ms) begin transaction
4000
+ ------------------------------------------------------------------------------------------
4001
+ BulkInsertWorkerTest: test_adapter_dependent_sqlite3_methods_(with_lowercase_adapter_name)
4002
+ ------------------------------------------------------------------------------------------
4003
+  (0.0ms) rollback transaction
4004
+  (0.0ms) begin transaction
4005
+ ------------------------------------------------------------------------------------------
4006
+ BulkInsertWorkerTest: test_adapter_dependent_sqlite3_methods_(with_stylecase_adapter_name)
4007
+ ------------------------------------------------------------------------------------------
4008
+  (0.0ms) rollback transaction
4009
+  (0.0ms) begin transaction
4010
+ ---------------------------------------------------------------
4011
+ BulkInsertWorkerTest: test_adapter_dependent_postgresql_methods
4012
+ ---------------------------------------------------------------
4013
+  (0.0ms) rollback transaction
4014
+  (0.1ms) begin transaction
4015
+ --------------------------------------------------------------------
4016
+ BulkInsertWorkerTest: test_before_save_callback_can_be_set_as_a_proc
4017
+ --------------------------------------------------------------------
4018
+  (0.0ms) rollback transaction
4019
+  (0.0ms) begin transaction
4020
+ ----------------------------------------------------------------
4021
+ BulkInsertWorkerTest: test_add_should_allow_values_given_as_Hash
4022
+ ----------------------------------------------------------------
4023
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',20,'f','2017-03-27 20:26:52.655886','2017-03-27 20:26:52.655886','chartreuse')
4024
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
4025
+  (0.3ms) rollback transaction
4026
+  (0.0ms) begin transaction
4027
+ -------------------------------------------
4028
+ BulkInsertWorkerTest: test_default_set_size
4029
+ -------------------------------------------
4030
+  (0.0ms) rollback transaction
4031
+  (0.0ms) begin transaction
4032
+ -------------------------------------------------------------
4033
+ BulkInsertWorkerTest: test_before_save_can_manipulate_the_set
4034
+ -------------------------------------------------------------
4035
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',25,'t','2017-03-27 20:26:52.662214','2017-03-27 20:26:52.662214','chartreuse')
4036
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
4037
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
4038
+  (0.3ms) rollback transaction
4039
+  (0.0ms) begin transaction
4040
+ ----------------------------------------------------------------
4041
+ BulkInsertWorkerTest: test_explicit_nil_should_override_defaults
4042
+ ----------------------------------------------------------------
4043
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',20,'f','2017-03-27 20:26:52.667975','2017-03-27 20:26:52.667975',NULL)
4044
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
4045
+  (0.2ms) rollback transaction
4046
+  (0.1ms) begin transaction
4047
+ --------------------------------------------------------------------------------
4048
+ BulkInsertWorkerTest: test_save!_doesn't_blow_up_if_before_save_emptying_the_set
4049
+ --------------------------------------------------------------------------------
4050
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
4051
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
4052
+  (0.0ms) rollback transaction
4053
+  (0.0ms) begin transaction
4054
+ -------------------------------------------------------------------
4055
+ BulkInsertWorkerTest: test_after_save_callback_can_be_set_as_a_proc
4056
+ -------------------------------------------------------------------
4057
+  (0.0ms) rollback transaction
4058
+  (0.0ms) begin transaction
4059
+ ---------------------------------------------------------------
4060
+ BulkInsertWorkerTest: test_before_save_stores_a_block_as_a_proc
4061
+ ---------------------------------------------------------------
4062
+  (0.0ms) rollback transaction
4063
+  (0.0ms) begin transaction
4064
+ ----------------------------------------------------------------------------------
4065
+ BulkInsertWorkerTest: test_add_should_save_automatically_when_overflowing_set_size
4066
+ ----------------------------------------------------------------------------------
4067
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-03-27 20:26:52.670747','2017-03-27 20:26:52.670747','chartreuse')
4068
+  (0.0ms) SELECT COUNT(*) FROM "testings"
4069
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
4070
+  (0.3ms) rollback transaction
4071
+  (0.0ms) begin transaction
4072
+ ----------------------------------------------------------------------------------------------
4073
+ BulkInsertWorkerTest: test_default_timestamp_columns_should_be_equivalent_for_the_entire_batch
4074
+ ----------------------------------------------------------------------------------------------
4075
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-03-27 20:26:52.672275','2017-03-27 20:26:52.672275','chartreuse'),('Howdy',20,'f','2017-03-27 20:26:52.672275','2017-03-27 20:26:52.672275','chartreuse')
4076
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings"
4077
+  (0.2ms) rollback transaction
4078
+  (0.0ms) begin transaction
4079
+ --------------------------------------------------------
4080
+ BulkInsertWorkerTest: test_save!_inserts_pending_records
4081
+ --------------------------------------------------------
4082
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',15,'f','2017-03-27 20:26:52.673749','2017-03-27 20:26:52.673749','chartreuse'),('Hello',25,'t','2017-03-27 20:26:52.673749','2017-03-27 20:26:52.673749','chartreuse')
4083
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
4084
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
4085
+  (0.3ms) rollback transaction
4086
+  (0.0ms) begin transaction
4087
+ -------------------------------------------------------------------------------
4088
+ BulkInsertWorkerTest: test_add_should_default_timestamp_columns_to_current_time
4089
+ -------------------------------------------------------------------------------
4090
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-03-27 20:26:52.675320','2017-03-27 20:26:52.675320','chartreuse')
4091
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
4092
+  (0.2ms) rollback transaction
4093
+  (0.0ms) begin transaction
4094
+ ------------------------------------------------------------------------------
4095
+ BulkInsertWorkerTest: test_add_should_use_database_default_values_when_present
4096
+ ------------------------------------------------------------------------------
4097
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',20,'f','2017-03-27 20:26:52.676884','2017-03-27 20:26:52.676884','chartreuse')
4098
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
4099
+  (0.2ms) rollback transaction
4100
+  (0.0ms) begin transaction
4101
+ --------------------------------------------------------------------
4102
+ BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
4103
+ --------------------------------------------------------------------
4104
+  (0.0ms) rollback transaction
4105
+  (0.0ms) begin transaction
4106
+ ----------------------------------------------------------------------------
4107
+ BulkInsertWorkerTest: test_pending_count_should_describe_size_of_pending_set
4108
+ ----------------------------------------------------------------------------
4109
+  (0.0ms) rollback transaction
4110
+  (0.0ms) begin transaction
4111
+ ---------------------------------------------------------------------
4112
+ BulkInsertWorkerTest: test_add_all_should_append_all_items_to_the_set
4113
+ ---------------------------------------------------------------------
4114
+  (0.0ms) rollback transaction
4115
+  (0.0ms) begin transaction
4116
+ ------------------------------------------------------
4117
+ BulkInsertWorkerTest: test_empty_insert_is_not_pending
4118
+ ------------------------------------------------------
4119
+  (0.0ms) rollback transaction
4120
+  (0.0ms) begin transaction
4121
+ -------------------------------------------------------------
4122
+ BulkInsertWorkerTest: test_save!_calls_the_after_save_handler
4123
+ -------------------------------------------------------------
4124
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',15,'f','2017-03-27 20:26:52.680173','2017-03-27 20:26:52.680173','chartreuse'),('Hello',25,'t','2017-03-27 20:26:52.680173','2017-03-27 20:26:52.680173','chartreuse')
4125
+  (0.2ms) rollback transaction
4126
+  (0.0ms) begin transaction
4127
+ --------------------------------------------------------------
4128
+ BulkInsertWorkerTest: test_save!_calls_the_before_save_handler
4129
+ --------------------------------------------------------------
4130
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',15,'f','2017-03-27 20:26:52.681699','2017-03-27 20:26:52.681699','chartreuse'),('Hello',25,'t','2017-03-27 20:26:52.681699','2017-03-27 20:26:52.681699','chartreuse')
4131
+  (0.2ms) rollback transaction
4132
+  (0.0ms) begin transaction
4133
+ ---------------------------------------------------------
4134
+ BulkInsertWorkerTest: test_save!_makes_insert_not_pending
4135
+ ---------------------------------------------------------
4136
+  (0.1ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-03-27 20:26:52.682916','2017-03-27 20:26:52.682916','chartreuse')
4137
+  (0.2ms) rollback transaction
4138
+  (0.0ms) begin transaction
4139
+ ----------------------------------------------------------
4140
+ BulkInsertWorkerTest: test_adapter_dependent_mysql_methods
4141
+ ----------------------------------------------------------
4142
+  (0.0ms) rollback transaction
4143
+  (0.0ms) begin transaction
4144
+ --------------------------------------------------------------
4145
+ BulkInsertWorkerTest: test_after_save_stores_a_block_as_a_proc
4146
+ --------------------------------------------------------------
4147
+  (0.0ms) rollback transaction
4148
+  (0.0ms) begin transaction
4149
+ ------------------------------------------------------------
4150
+ BulkInsertWorkerTest: test_adapter_dependent_default_methods
4151
+ ------------------------------------------------------------
4152
+  (0.0ms) rollback transaction
4153
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
4154
+  (0.1ms) begin transaction
4155
+ -------------------------------------------------------------------
4156
+ BulkInsertTest: test_bulk_insert_without_block_should_return_worker
4157
+ -------------------------------------------------------------------
4158
+  (0.0ms) rollback transaction
4159
+  (0.0ms) begin transaction
4160
+ -----------------------------------------------------------------------------
4161
+ BulkInsertTest: test_bulk_insert_with_array_should_save_the_array_immediately
4162
+ -----------------------------------------------------------------------------
4163
+  (0.3ms) SELECT COUNT(*) FROM "testings"
4164
+  (0.0ms) SAVEPOINT active_record_1
4165
+  (0.6ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','green','2017-06-19 19:56:44.781418','chartreuse'),('Hey',20,'f','2017-06-19 19:56:44.781418','2017-06-19 19:56:44.781418','chartreuse')
4166
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4167
+  (0.0ms) SELECT COUNT(*) FROM "testings"
4168
+  (0.3ms) rollback transaction
4169
+  (0.0ms) begin transaction
4170
+ ---------------------------------------------------------------
4171
+ BulkInsertTest: test_bulk_insert_with_block_should_yield_worker
4172
+ ---------------------------------------------------------------
4173
+  (0.0ms) SAVEPOINT active_record_1
4174
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4175
+  (0.0ms) rollback transaction
4176
+  (0.0ms) begin transaction
4177
+ ---------------------------------------------------------------------
4178
+ BulkInsertTest: test_bulk_insert_with_block_should_save_automatically
4179
+ ---------------------------------------------------------------------
4180
+  (0.0ms) SELECT COUNT(*) FROM "testings"
4181
+  (0.0ms) SAVEPOINT active_record_1
4182
+  (0.1ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',NULL,NULL,'2017-06-19 19:56:44.786035','2017-06-19 19:56:44.786035','chartreuse')
4183
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4184
+  (0.0ms) SELECT COUNT(*) FROM "testings"
4185
+  (0.3ms) rollback transaction
4186
+  (0.0ms) begin transaction
4187
+ ------------------------------------------------------------------------------
4188
+ BulkInsertTest: test_default_bulk_columns_should_return_all_columns_without_id
4189
+ ------------------------------------------------------------------------------
4190
+  (0.0ms) rollback transaction
4191
+  (0.0ms) begin transaction
4192
+ -------------------------------------------
4193
+ BulkInsertWorkerTest: test_default_set_size
4194
+ -------------------------------------------
4195
+  (0.0ms) rollback transaction
4196
+  (0.1ms) begin transaction
4197
+ ---------------------------------------------------------------
4198
+ BulkInsertWorkerTest: test_before_save_stores_a_block_as_a_proc
4199
+ ---------------------------------------------------------------
4200
+  (0.0ms) rollback transaction
4201
+  (0.0ms) begin transaction
4202
+ --------------------------------------------------------------------
4203
+ BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
4204
+ --------------------------------------------------------------------
4205
+  (0.0ms) rollback transaction
4206
+  (0.0ms) begin transaction
4207
+ --------------------------------------------------------------------------------
4208
+ BulkInsertWorkerTest: test_save!_doesn't_blow_up_if_before_save_emptying_the_set
4209
+ --------------------------------------------------------------------------------
4210
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
4211
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
4212
+  (0.0ms) rollback transaction
4213
+  (0.0ms) begin transaction
4214
+ ----------------------------------------------------------------
4215
+ BulkInsertWorkerTest: test_explicit_nil_should_override_defaults
4216
+ ----------------------------------------------------------------
4217
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',20,'f','2017-06-19 19:56:44.796867','2017-06-19 19:56:44.796867',NULL)
4218
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
4219
+  (0.3ms) rollback transaction
4220
+  (0.0ms) begin transaction
4221
+ -------------------------------------------------------------------
4222
+ BulkInsertWorkerTest: test_save!_when_not_pending_should_do_nothing
4223
+ -------------------------------------------------------------------
4224
+  (0.1ms) SELECT COUNT(*) FROM "testings"
4225
+  (0.0ms) SELECT COUNT(*) FROM "testings"
4226
+  (0.0ms) rollback transaction
4227
+  (0.0ms) begin transaction
4228
+ ---------------------------------------------------------------------
4229
+ BulkInsertWorkerTest: test_add_all_should_append_all_items_to_the_set
4230
+ ---------------------------------------------------------------------
4231
+  (0.0ms) rollback transaction
4232
+  (0.0ms) begin transaction
4233
+ -------------------------------------------------------------------
4234
+ BulkInsertWorkerTest: test_after_save_callback_can_be_set_as_a_proc
4235
+ -------------------------------------------------------------------
4236
+  (0.0ms) rollback transaction
4237
+  (0.0ms) begin transaction
4238
+ ----------------------------------------------------------------------------------
4239
+ BulkInsertWorkerTest: test_add_should_save_automatically_when_overflowing_set_size
4240
+ ----------------------------------------------------------------------------------
4241
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-06-19 19:56:44.804725','2017-06-19 19:56:44.804725','chartreuse')
4242
+  (0.0ms) SELECT COUNT(*) FROM "testings"
4243
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
4244
+  (0.2ms) rollback transaction
4245
+  (0.0ms) begin transaction
4246
+ ---------------------------------------------------------------
4247
+ BulkInsertWorkerTest: test_adapter_dependent_postgresql_methods
4248
+ ---------------------------------------------------------------
4249
+  (0.0ms) rollback transaction
4250
+  (0.1ms) begin transaction
4251
+ ---------------------------------------------------------
4252
+ BulkInsertWorkerTest: test_save!_makes_insert_not_pending
4253
+ ---------------------------------------------------------
4254
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-06-19 19:56:44.807998','2017-06-19 19:56:44.807998','chartreuse')
4255
+  (0.4ms) rollback transaction
4256
+  (0.0ms) begin transaction
4257
+ ------------------------------------------------------------------------------
4258
+ BulkInsertWorkerTest: test_add_should_use_database_default_values_when_present
4259
+ ------------------------------------------------------------------------------
4260
+  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',20,'f','2017-06-19 19:56:44.809424','2017-06-19 19:56:44.809424','chartreuse')
4261
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
4262
+  (0.3ms) rollback transaction
4263
+  (0.0ms) begin transaction
4264
+ --------------------------------------------------------------------
4265
+ BulkInsertWorkerTest: test_before_save_callback_can_be_set_as_a_proc
4266
+ --------------------------------------------------------------------
4267
+  (0.1ms) rollback transaction
4268
+  (0.0ms) begin transaction
4269
+ --------------------------------------------------------
4270
+ BulkInsertWorkerTest: test_save!_inserts_pending_records
4271
+ --------------------------------------------------------
4272
+  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',15,'f','2017-06-19 19:56:44.812000','2017-06-19 19:56:44.812000','chartreuse'),('Hello',25,'t','2017-06-19 19:56:44.812000','2017-06-19 19:56:44.812000','chartreuse')
4273
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
4274
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
4275
+  (0.3ms) rollback transaction
4276
+  (0.0ms) begin transaction
4277
+ ------------------------------------------------------------
4278
+ BulkInsertWorkerTest: test_adapter_dependent_default_methods
4279
+ ------------------------------------------------------------
4280
+  (0.0ms) rollback transaction
4281
+  (0.0ms) begin transaction
4282
+ ----------------------------------------------------------------
4283
+ BulkInsertWorkerTest: test_add_should_allow_values_given_as_Hash
4284
+ ----------------------------------------------------------------
4285
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',20,'f','2017-06-19 19:56:44.814679','2017-06-19 19:56:44.814679','chartreuse')
4286
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
4287
+  (0.2ms) rollback transaction
4288
+  (0.0ms) begin transaction
4289
+ ----------------------------------------------------------------------------------------------
4290
+ BulkInsertWorkerTest: test_default_timestamp_columns_should_be_equivalent_for_the_entire_batch
4291
+ ----------------------------------------------------------------------------------------------
4292
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-06-19 19:56:44.816304','2017-06-19 19:56:44.816304','chartreuse'),('Howdy',20,'f','2017-06-19 19:56:44.816304','2017-06-19 19:56:44.816304','chartreuse')
4293
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings"
4294
+  (0.2ms) rollback transaction
4295
+  (0.0ms) begin transaction
4296
+ --------------------------------------------------------------
4297
+ BulkInsertWorkerTest: test_after_save_stores_a_block_as_a_proc
4298
+ --------------------------------------------------------------
4299
+  (0.0ms) rollback transaction
4300
+  (0.0ms) begin transaction
4301
+ ------------------------------------------------------
4302
+ BulkInsertWorkerTest: test_empty_insert_is_not_pending
4303
+ ------------------------------------------------------
4304
+  (0.0ms) rollback transaction
4305
+  (0.0ms) begin transaction
4306
+ ----------------------------------------------------------
4307
+ BulkInsertWorkerTest: test_adapter_dependent_mysql_methods
4308
+ ----------------------------------------------------------
4309
+  (0.0ms) rollback transaction
4310
+  (0.0ms) begin transaction
4311
+ ------------------------------------------------------------------------------------------
4312
+ BulkInsertWorkerTest: test_adapter_dependent_sqlite3_methods_(with_lowercase_adapter_name)
4313
+ ------------------------------------------------------------------------------------------
4314
+  (0.0ms) rollback transaction
4315
+  (0.0ms) begin transaction
4316
+ -------------------------------------------------------------
4317
+ BulkInsertWorkerTest: test_before_save_can_manipulate_the_set
4318
+ -------------------------------------------------------------
4319
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',25,'t','2017-06-19 19:56:44.820721','2017-06-19 19:56:44.820721','chartreuse')
4320
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
4321
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
4322
+  (0.3ms) rollback transaction
4323
+  (0.0ms) begin transaction
4324
+ ----------------------------------------------------------------------------
4325
+ BulkInsertWorkerTest: test_pending_count_should_describe_size_of_pending_set
4326
+ ----------------------------------------------------------------------------
4327
+  (0.0ms) rollback transaction
4328
+  (0.0ms) begin transaction
4329
+ ------------------------------------------------------------------------------------------
4330
+ BulkInsertWorkerTest: test_adapter_dependent_sqlite3_methods_(with_stylecase_adapter_name)
4331
+ ------------------------------------------------------------------------------------------
4332
+  (0.0ms) rollback transaction
4333
+  (0.0ms) begin transaction
4334
+ --------------------------------------------------------------
4335
+ BulkInsertWorkerTest: test_save!_calls_the_before_save_handler
4336
+ --------------------------------------------------------------
4337
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',15,'f','2017-06-19 19:56:44.823361','2017-06-19 19:56:44.823361','chartreuse'),('Hello',25,'t','2017-06-19 19:56:44.823361','2017-06-19 19:56:44.823361','chartreuse')
4338
+  (0.2ms) rollback transaction
4339
+  (0.0ms) begin transaction
4340
+ -------------------------------------------------------------------------------
4341
+ BulkInsertWorkerTest: test_add_should_default_timestamp_columns_to_current_time
4342
+ -------------------------------------------------------------------------------
4343
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-06-19 19:56:44.824407','2017-06-19 19:56:44.824407','chartreuse')
4344
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
4345
+  (0.2ms) rollback transaction
4346
+  (0.0ms) begin transaction
4347
+ -------------------------------------------------------------
4348
+ BulkInsertWorkerTest: test_save!_calls_the_after_save_handler
4349
+ -------------------------------------------------------------
4350
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',15,'f','2017-06-19 19:56:44.825699','2017-06-19 19:56:44.825699','chartreuse'),('Hello',25,'t','2017-06-19 19:56:44.825699','2017-06-19 19:56:44.825699','chartreuse')
4351
+  (0.2ms) rollback transaction