bulk_insert 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a4e0d183ca8739d8b1fc3a49f9fa202a2e680ab9
4
- data.tar.gz: c5e41cf70f177ddd5d0dd8238c82cb037c9f0055
3
+ metadata.gz: 449bfe0d3987075fcf560eecb0ad8d8c81b3239d
4
+ data.tar.gz: 7484ff28b2ab6ed401977c67b5296af5e6359986
5
5
  SHA512:
6
- metadata.gz: 53ceccf9f12ca48381a924f6b7d72b398003b88e17c364700c85293e309cc2db8aa6710db51312614fff4fa9cd1691e8dd5fc089fa55de1c499ab1099716a47b
7
- data.tar.gz: da31d80b39821b97292d5da6a1ca2f1df6b9b6ced154637ce81472c2fdecb6aa4fc623ec64b5ee15470ac9f0a9f6195bb4261fc0d9940c436931aae9c73a43b7
6
+ metadata.gz: ad244bb00d9f45fae61c1c0dea28b0b17e997fcfbf3e2c123211fc7f417ab94328f56623978b4e80289b2214fd4a76d81dcccc432cd8c52de562bdff7b7630da
7
+ data.tar.gz: a0640187afe8277f22542694b91749b95f53107a5b2930222e0a4d4d538c1d33f021fd8d86c310efa09629a83bbec1328fd86b0131495c95d5c9ed2d91b88ad0
data/README.md CHANGED
@@ -7,65 +7,102 @@ single insert statement.
7
7
 
8
8
  Add it to your Gemfile:
9
9
 
10
- gem 'bulk_insert'
10
+ ```ruby
11
+ gem 'bulk_insert'
12
+ ```
11
13
 
12
14
  ## Usage
13
15
 
14
16
  BulkInsert adds a new class method to your ActiveRecord models:
15
17
 
16
- class Book < ActiveRecord::Base
17
- end
18
+ ```ruby
19
+ class Book < ActiveRecord::Base
20
+ end
18
21
 
19
- book_attrs = ... # some array of hashes, for instance
20
- Book.bulk_insert do |worker|
21
- book_attrs.each do |attrs|
22
- worker.add(attrs)
23
- end
24
- end
22
+ book_attrs = ... # some array of hashes, for instance
23
+ Book.bulk_insert do |worker|
24
+ book_attrs.each do |attrs|
25
+ worker.add(attrs)
26
+ end
27
+ end
28
+ ```
25
29
 
26
30
  All of those `#add` calls will be accumulated into a single SQL insert
27
31
  statement, vastly improving the performance of multiple sequential
28
32
  inserts (think data imports and the like).
29
33
 
34
+ If you don't like using a block API, you can also simply pass an array
35
+ of rows to be inserted:
36
+
37
+ ```ruby
38
+ book_attrs = ... # some array of hashes, for instance
39
+ Book.bulk_insert values: book_attrs
40
+ ```
41
+
30
42
  By default, the columns to be inserted will be all columns in the table,
31
43
  minus the `id` column, but if you want, you can explicitly enumerate
32
44
  the columns:
33
45
 
34
- Book.bulk_insert(:title, :author) do |worker|
35
- # specify a row as an array of values...
36
- worker.add ["Eye of the World", "Robert Jordan"]
46
+ ```ruby
47
+ Book.bulk_insert(:title, :author) do |worker|
48
+ # specify a row as an array of values...
49
+ worker.add ["Eye of the World", "Robert Jordan"]
37
50
 
38
- # or as a hash
39
- worker.add title: "Lord of Light", author: "Roger Zelazny"
40
- end
51
+ # or as a hash
52
+ worker.add title: "Lord of Light", author: "Roger Zelazny"
53
+ end
54
+ ```
41
55
 
42
56
  It will automatically set `created_at`/`updated_at` columns to the current
43
57
  date, as well.
44
58
 
45
- Book.bulk_insert(:title, :author, :created_at, :updated_at) do |worker|
46
- # specify created_at/updated_at explicitly...
47
- worker.add ["The Chosen", "Chaim Potok", Time.now, Time.now]
59
+ ```ruby
60
+ Book.bulk_insert(:title, :author, :created_at, :updated_at) do |worker|
61
+ # specify created_at/updated_at explicitly...
62
+ worker.add ["The Chosen", "Chaim Potok", Time.now, Time.now]
63
+
64
+ # or let BulkInsert set them by default...
65
+ worker.add ["Hello Ruby", "Linda Liukas"]
66
+ end
67
+ ```
68
+
69
+ Similarly, if a value is omitted, BulkInsert will use whatever default
70
+ value is defined for that column in the database:
48
71
 
49
- # or let BulkInsert set them by default...
50
- worker.add ["Hello Ruby", "Linda Liukas"]
51
- end
72
+ ```ruby
73
+ # create_table :books do |t|
74
+ # ...
75
+ # t.string "medium", default: "paper"
76
+ # ...
77
+ # end
78
+
79
+ Book.bulk_insert(:title, :author, :medium) do |worker|
80
+ worker.add title: "Ender's Game", author: "Orson Scott Card"
81
+ end
82
+
83
+ Book.first.medium #-> "paper"
84
+ ```
52
85
 
53
86
  By default, the batch is always saved when the block finishes, but you
54
87
  can explicitly save inside the block whenever you want, by calling
55
88
  `#save!` on the worker:
56
89
 
57
- Book.bulk_insert do |worker|
58
- worker.add(...)
59
- worker.add(...)
90
+ ```ruby
91
+ Book.bulk_insert do |worker|
92
+ worker.add(...)
93
+ worker.add(...)
60
94
 
61
- worker.save!
95
+ worker.save!
62
96
 
63
- worker.add(...)
64
- #...
65
- end
97
+ worker.add(...)
98
+ #...
99
+ end
100
+ ```
66
101
 
67
102
  That will save the batch as it has been defined to that point, and then
68
- empty the batch so that you can add more rows to it if you want.
103
+ empty the batch so that you can add more rows to it if you want. Note
104
+ that all records saved together will have the same created_at/updated_at
105
+ timestamp (unless one was explicitly set).
69
106
 
70
107
 
71
108
  ### Batch Set Size
@@ -78,17 +115,18 @@ and executed, and the batch is reset.
78
115
  If you want a larger (or smaller) set size, you can specify it in
79
116
  two ways:
80
117
 
81
- # specify set_size when initializing the bulk insert...
82
- Book.bulk_insert(set_size: 100) do |worker|
83
- # ...
84
- end
85
-
86
- # specify it on the worker directly...
87
- Book.bulk_insert do |worker|
88
- worker.set_size = 100
89
- # ...
90
- end
91
-
118
+ ```ruby
119
+ # specify set_size when initializing the bulk insert...
120
+ Book.bulk_insert(set_size: 100) do |worker|
121
+ # ...
122
+ end
123
+
124
+ # specify it on the worker directly...
125
+ Book.bulk_insert do |worker|
126
+ worker.set_size = 100
127
+ # ...
128
+ end
129
+ ```
92
130
 
93
131
  ## License
94
132
 
@@ -4,20 +4,32 @@ module BulkInsert
4
4
  extend ActiveSupport::Concern
5
5
 
6
6
  class_methods do
7
- def bulk_insert(*columns, set_size:500)
8
- columns = self.column_names - %w(id) if columns.empty?
7
+ def bulk_insert(*columns, values: nil, set_size:500)
8
+ columns = default_bulk_columns if columns.empty?
9
9
  worker = BulkInsert::Worker.new(connection, table_name, columns, set_size)
10
10
 
11
- if block_given?
11
+ if values.present?
12
+ transaction do
13
+ worker.add_all(values)
14
+ worker.save!
15
+ end
16
+ nil
17
+ elsif block_given?
12
18
  transaction do
13
19
  yield worker
14
20
  worker.save!
15
21
  end
16
- self
22
+ nil
17
23
  else
18
24
  worker
19
25
  end
20
26
  end
27
+
28
+ # helper method for preparing the columns before a call to :bulk_insert
29
+ def default_bulk_columns
30
+ self.column_names - %w(id)
31
+ end
32
+
21
33
  end
22
34
  end
23
35
 
@@ -1,6 +1,6 @@
1
1
  module BulkInsert
2
2
  MAJOR = 1
3
- MINOR = 0
3
+ MINOR = 1
4
4
  TINY = 0
5
5
 
6
6
  VERSION = [MAJOR, MINOR, TINY].join(".")
@@ -21,34 +21,48 @@ module BulkInsert
21
21
  @set.any?
22
22
  end
23
23
 
24
+ def pending_count
25
+ @set.count
26
+ end
27
+
24
28
  def add(values)
25
29
  save! if @set.length >= set_size
26
30
 
27
31
  values = values.with_indifferent_access if values.is_a?(Hash)
28
32
  mapped = @columns.map.with_index do |column, index|
29
- value = values.is_a?(Hash) ? values[column.name] : values[index]
30
- if value.nil?
31
- if column.name == "created_at" || column.name == "updated_at"
32
- Time.now
33
+ value_exists = values.is_a?(Hash) ? values.key?(column.name) : (index < values.length)
34
+ if !value_exists
35
+ if column.default.present?
36
+ column.default
37
+ elsif column.name == "created_at" || column.name == "updated_at"
38
+ :__timestamp_placeholder
33
39
  else
34
- value
40
+ nil
35
41
  end
36
42
  else
37
- value
43
+ values.is_a?(Hash) ? values[column.name] : values[index]
38
44
  end
39
45
  end
40
46
 
41
47
  @set.push(mapped)
48
+ self
49
+ end
50
+
51
+ def add_all(rows)
52
+ rows.each { |row| add(row) }
53
+ self
42
54
  end
43
55
 
44
56
  def save!
45
57
  if pending?
46
58
  sql = "INSERT INTO #{@table_name} (#{@column_names}) VALUES "
59
+ @now = Time.now
47
60
 
48
61
  rows = []
49
62
  @set.each do |row|
50
63
  values = []
51
64
  @columns.zip(row) do |column, value|
65
+ value = @now if value == :__timestamp_placeholder
52
66
  values << @connection.quote(value, column)
53
67
  end
54
68
  rows << "(#{values.join(',')})"
@@ -59,6 +73,8 @@ module BulkInsert
59
73
 
60
74
  @set.clear
61
75
  end
76
+
77
+ self
62
78
  end
63
79
  end
64
80
  end
@@ -5,7 +5,7 @@ class BulkInsertWorkerTest < ActiveSupport::TestCase
5
5
  @insert = BulkInsert::Worker.new(
6
6
  Testing.connection,
7
7
  Testing.table_name,
8
- %w(greeting age happy created_at updated_at))
8
+ %w(greeting age happy created_at updated_at color))
9
9
  @now = Time.now
10
10
  end
11
11
 
@@ -13,6 +13,12 @@ class BulkInsertWorkerTest < ActiveSupport::TestCase
13
13
  assert_equal false, @insert.pending?
14
14
  end
15
15
 
16
+ test "pending_count should describe size of pending set" do
17
+ assert_equal 0, @insert.pending_count
18
+ @insert.add ["Hello", 15, true, @now, @now]
19
+ assert_equal 1, @insert.pending_count
20
+ end
21
+
16
22
  test "default set size" do
17
23
  assert_equal 500, @insert.set_size
18
24
  end
@@ -33,6 +39,32 @@ class BulkInsertWorkerTest < ActiveSupport::TestCase
33
39
  assert_operator record.updated_at, :>=, now
34
40
  end
35
41
 
42
+ test "default timestamp columns should be equivalent for the entire batch" do
43
+ @insert.add ["Hello", 15, true]
44
+ @insert.add ["Howdy", 20, false]
45
+ @insert.save!
46
+
47
+ first, second = Testing.all
48
+ assert_equal first.created_at.to_f, second.created_at.to_f
49
+ assert_equal first.created_at.to_f, first.updated_at.to_f
50
+ end
51
+
52
+ test "add should use database default values when present" do
53
+ @insert.add greeting: "Hello", age: 20, happy: false
54
+ @insert.save!
55
+
56
+ record = Testing.first
57
+ assert_equal record.color, "chartreuse"
58
+ end
59
+
60
+ test "explicit nil should override defaults" do
61
+ @insert.add greeting: "Hello", age: 20, happy: false, color: nil
62
+ @insert.save!
63
+
64
+ record = Testing.first
65
+ assert_nil record.color
66
+ end
67
+
36
68
  test "add should allow values given as Hash" do
37
69
  @insert.add greeting: "Yo", age: 20, happy: false, created_at: @now, updated_at: @now
38
70
  @insert.save!
@@ -52,6 +84,14 @@ class BulkInsertWorkerTest < ActiveSupport::TestCase
52
84
  assert_equal "Hello", Testing.first.greeting
53
85
  end
54
86
 
87
+ test "add_all should append all items to the set" do
88
+ @insert.add_all [
89
+ [ "Hello", 15, true ],
90
+ { greeting: "Hi", age: 55, happy: true }
91
+ ]
92
+ assert_equal 2, @insert.pending_count
93
+ end
94
+
55
95
  test "save! makes insert not pending" do
56
96
  @insert.add ["Hello", 15, true, @now, @now]
57
97
  @insert.save!
@@ -19,4 +19,20 @@ class BulkInsertTest < ActiveSupport::TestCase
19
19
  end
20
20
  end
21
21
  end
22
+
23
+ test "bulk_insert with array should save the array immediately" do
24
+ assert_difference "Testing.count", 2 do
25
+ Testing.bulk_insert values: [
26
+ [ "Hello", 15, true, "green" ],
27
+ { greeting: "Hey", age: 20, happy: false }
28
+ ]
29
+ end
30
+ end
31
+
32
+ test "default_bulk_columns should return all columns without id" do
33
+ default_columns = %w(greeting age happy created_at updated_at color)
34
+
35
+ assert_equal Testing.default_bulk_columns, default_columns
36
+ end
37
+
22
38
  end
@@ -0,0 +1,5 @@
1
+ class AddDefaultValue < ActiveRecord::Migration
2
+ def change
3
+ add_column :testings, :color, :string, default: "chartreuse"
4
+ end
5
+ end
@@ -11,14 +11,15 @@
11
11
  #
12
12
  # It's strongly recommended that you check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(version: 20151008181535) do
14
+ ActiveRecord::Schema.define(version: 20151028194232) do
15
15
 
16
16
  create_table "testings", force: :cascade do |t|
17
17
  t.string "greeting"
18
18
  t.integer "age"
19
19
  t.boolean "happy"
20
- t.datetime "created_at", null: false
21
- t.datetime "updated_at", null: false
20
+ t.datetime "created_at", null: false
21
+ t.datetime "updated_at", null: false
22
+ t.string "color", default: "chartreuse"
22
23
  end
23
24
 
24
25
  end
Binary file
@@ -8,3 +8,10 @@ Migrating to CreateTestings (20151008181535)
8
8
  SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20151008181535"]]
9
9
   (0.8ms) commit transaction
10
10
  ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
11
+ ActiveRecord::SchemaMigration Load (0.7ms) SELECT "schema_migrations".* FROM "schema_migrations"
12
+ Migrating to AddDefaultValue (20151028194232)
13
+  (0.1ms) begin transaction
14
+  (0.4ms) ALTER TABLE "testings" ADD "color" varchar DEFAULT 'chartreuse'
15
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20151028194232"]]
16
+  (2.1ms) commit transaction
17
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
@@ -1,726 +1,317 @@
1
-  (0.1ms) begin transaction
2
- ------------------------------------------------------
3
- BulkInsertWorkerTest: test_empty_insert_is_not_pending
4
- ------------------------------------------------------
5
-  (0.0ms) rollback transaction
6
-  (0.0ms) begin transaction
7
- --------------------------
8
- BulkInsertTest: test_truth
9
- --------------------------
10
-  (0.0ms) rollback transaction
11
-  (0.1ms) begin transaction
12
- ------------------------------------------------------
13
- BulkInsertWorkerTest: test_empty_insert_is_not_pending
14
- ------------------------------------------------------
15
-  (0.0ms) rollback transaction
16
-  (0.0ms) begin transaction
17
- --------------------------
18
- BulkInsertTest: test_truth
19
- --------------------------
20
-  (0.0ms) rollback transaction
21
-  (0.1ms) begin transaction
22
- ------------------------------------------------------
23
- BulkInsertWorkerTest: test_empty_insert_is_not_pending
24
- ------------------------------------------------------
25
-  (0.0ms) rollback transaction
26
-  (0.0ms) begin transaction
27
- --------------------------
28
- BulkInsertTest: test_truth
29
- --------------------------
30
-  (0.0ms) rollback transaction
31
-  (0.1ms) begin transaction
32
- ------------------------------------------------------
33
- BulkInsertWorkerTest: test_empty_insert_is_not_pending
34
- ------------------------------------------------------
35
-  (0.0ms) rollback transaction
36
-  (0.0ms) begin transaction
37
- --------------------------
38
- BulkInsertTest: test_truth
39
- --------------------------
40
-  (0.1ms) rollback transaction
41
-  (0.1ms) begin transaction
42
- --------------------------
43
- BulkInsertTest: test_truth
44
- --------------------------
45
-  (0.0ms) rollback transaction
46
-  (0.0ms) begin transaction
47
- ------------------------------------------------------
48
- BulkInsertWorkerTest: test_empty_insert_is_not_pending
49
- ------------------------------------------------------
50
-  (0.0ms) rollback transaction
51
-  (0.1ms) begin transaction
52
- --------------------------
53
- BulkInsertTest: test_truth
54
- --------------------------
55
-  (0.0ms) rollback transaction
56
-  (0.0ms) begin transaction
57
- ------------------------------------------------------
58
- BulkInsertWorkerTest: test_empty_insert_is_not_pending
59
- ------------------------------------------------------
60
-  (0.0ms) rollback transaction
61
-  (0.0ms) begin transaction
62
- --------------------------------------------------------------------
63
- BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
64
- --------------------------------------------------------------------
65
-  (0.0ms) rollback transaction
66
-  (0.1ms) begin transaction
67
- --------------------------
68
- BulkInsertTest: test_truth
69
- --------------------------
70
-  (0.0ms) rollback transaction
71
-  (0.0ms) begin transaction
72
- --------------------------------------------------------------------
73
- BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
74
- --------------------------------------------------------------------
75
-  (0.0ms) rollback transaction
76
-  (0.0ms) begin transaction
77
- ------------------------------------------------------
78
- BulkInsertWorkerTest: test_empty_insert_is_not_pending
79
- ------------------------------------------------------
80
-  (0.0ms) rollback transaction
81
-  (0.2ms) begin transaction
82
- --------------------------
83
- BulkInsertTest: test_truth
84
- --------------------------
85
-  (0.1ms) rollback transaction
86
-  (0.0ms) begin transaction
87
- ------------------------------------------------------
88
- BulkInsertWorkerTest: test_empty_insert_is_not_pending
89
- ------------------------------------------------------
90
-  (0.0ms) rollback transaction
91
-  (0.1ms) begin transaction
92
- --------------------------------------------------------------------
93
- BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
94
- --------------------------------------------------------------------
95
-  (0.1ms) rollback transaction
96
-  (0.1ms) begin transaction
97
- ---------------------------------------------------------
98
- BulkInsertWorkerTest: test_save!_makes_insert_not_pending
99
- ---------------------------------------------------------
100
-  (0.0ms) rollback transaction
101
-  (0.1ms) begin transaction
102
- ---------------------------------------------------------
103
- BulkInsertWorkerTest: test_save!_makes_insert_not_pending
104
- ---------------------------------------------------------
105
-  (0.1ms) rollback transaction
106
-  (0.1ms) begin transaction
107
- ------------------------------------------------------
108
- BulkInsertWorkerTest: test_empty_insert_is_not_pending
109
- ------------------------------------------------------
110
-  (0.0ms) rollback transaction
111
-  (0.1ms) begin transaction
112
- --------------------------------------------------------------------
113
- BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
114
- --------------------------------------------------------------------
115
-  (0.0ms) rollback transaction
116
-  (0.0ms) begin transaction
117
- --------------------------
118
- BulkInsertTest: test_truth
119
- --------------------------
120
-  (0.0ms) rollback transaction
121
-  (0.1ms) begin transaction
122
- ---------------------------------------------------------
123
- BulkInsertWorkerTest: test_save!_makes_insert_not_pending
124
- ---------------------------------------------------------
125
-  (0.0ms) rollback transaction
126
-  (0.1ms) begin transaction
127
- ------------------------------------------------------
128
- BulkInsertWorkerTest: test_empty_insert_is_not_pending
129
- ------------------------------------------------------
130
-  (0.1ms) rollback transaction
131
-  (0.1ms) begin transaction
132
- --------------------------------------------------------------------
133
- BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
134
- --------------------------------------------------------------------
135
-  (0.0ms) rollback transaction
136
-  (0.1ms) begin transaction
137
- --------------------------------------------------------
138
- BulkInsertWorkerTest: test_save!_inserts_pending_records
139
- --------------------------------------------------------
140
-  (0.1ms) rollback transaction
141
-  (0.0ms) begin transaction
142
- --------------------------
143
- BulkInsertTest: test_truth
144
- --------------------------
145
-  (0.0ms) rollback transaction
146
-  (2.7ms) CREATE TABLE "testings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "greeting" varchar, "age" integer, "happy" boolean, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
147
-  (1.1ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
148
-  (0.1ms) select sqlite_version(*)
149
-  (1.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
150
-  (0.2ms) SELECT version FROM "schema_migrations"
151
-  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20151008181535')
152
1
  ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
153
2
   (0.1ms) begin transaction
154
- --------------------------
155
- BulkInsertTest: test_truth
156
- --------------------------
157
-  (0.0ms) rollback transaction
158
-  (0.1ms) begin transaction
159
- --------------------------------------------------------
160
- BulkInsertWorkerTest: test_save!_inserts_pending_records
161
- --------------------------------------------------------
162
- Testing Load (0.2ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
163
- Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
164
-  (0.1ms) rollback transaction
165
-  (0.1ms) begin transaction
166
- ------------------------------------------------------
167
- BulkInsertWorkerTest: test_empty_insert_is_not_pending
168
- ------------------------------------------------------
169
-  (0.1ms) rollback transaction
170
-  (0.1ms) begin transaction
171
- ---------------------------------------------------------
172
- BulkInsertWorkerTest: test_save!_makes_insert_not_pending
173
- ---------------------------------------------------------
174
-  (0.0ms) rollback transaction
175
-  (0.0ms) begin transaction
176
- --------------------------------------------------------------------
177
- BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
178
- --------------------------------------------------------------------
179
-  (0.0ms) rollback transaction
3
+ ----------------------------------------------------------------------------------------------
4
+ BulkInsertWorkerTest: test_default_timestamp_columns_should_be_equivalent_for_the_entire_batch
5
+ ----------------------------------------------------------------------------------------------
6
+  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","color","created_at","updated_at") VALUES ('Hello',15,'t','chartreuse','2015-10-28 19:56:12.010467','2015-10-28 19:56:12.010467'),('Howdy',20,'f','chartreuse','2015-10-28 19:56:12.010467','2015-10-28 19:56:12.010467')
7
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings"
8
+  (2.2ms) rollback transaction
180
9
  ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
181
10
   (0.1ms) begin transaction
182
- --------------------------
183
- BulkInsertTest: test_truth
184
- --------------------------
185
-  (0.1ms) rollback transaction
186
-  (0.0ms) begin transaction
187
- --------------------------------------------------------------------
188
- BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
189
- --------------------------------------------------------------------
11
+ ------------------------------------------------------------------------------
12
+ BulkInsertTest: test_default_bulk_columns_should_return_all_columns_without_id
13
+ ------------------------------------------------------------------------------
190
14
   (0.0ms) rollback transaction
191
15
   (0.1ms) begin transaction
192
- ------------------------------------------------------
193
- BulkInsertWorkerTest: test_empty_insert_is_not_pending
194
- ------------------------------------------------------
16
+ -------------------------------------------------------------------
17
+ BulkInsertTest: test_bulk_insert_without_block_should_return_worker
18
+ -------------------------------------------------------------------
195
19
   (0.0ms) rollback transaction
196
20
   (0.0ms) begin transaction
21
+ ---------------------------------------------------------------
22
+ BulkInsertTest: test_bulk_insert_with_block_should_yield_worker
23
+ ---------------------------------------------------------------
24
+  (0.0ms) SAVEPOINT active_record_1
25
+  (0.0ms) RELEASE SAVEPOINT active_record_1
26
+  (0.0ms) rollback transaction
27
+  (0.1ms) begin transaction
28
+ ---------------------------------------------------------------------
29
+ BulkInsertTest: test_bulk_insert_with_block_should_save_automatically
30
+ ---------------------------------------------------------------------
31
+  (0.1ms) SELECT COUNT(*) FROM "testings"
32
+  (0.0ms) SAVEPOINT active_record_1
33
+  (0.8ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',NULL,NULL,'2015-10-28 19:58:04.040969','2015-10-28 19:58:04.040969','chartreuse')
34
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35
+  (0.1ms) SELECT COUNT(*) FROM "testings"
36
+  (0.5ms) rollback transaction
37
+  (0.0ms) begin transaction
197
38
  --------------------------------------------------------
198
39
  BulkInsertWorkerTest: test_save!_inserts_pending_records
199
40
  --------------------------------------------------------
200
- Testing Load (0.3ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
41
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","color","created_at","updated_at") VALUES ('Yo',15,'f','2015-10-28 19:58:04.045737','2015-10-28 19:58:04.045737','2015-10-28 19:58:04.045767'),('Hello',25,'t','2015-10-28 19:58:04.045737','2015-10-28 19:58:04.045737','2015-10-28 19:58:04.045767')
42
+ Testing Load (0.2ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
201
43
  Testing Load (0.1ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
202
-  (0.1ms) rollback transaction
203
-  (0.2ms) begin transaction
204
- ---------------------------------------------------------
205
- BulkInsertWorkerTest: test_save!_makes_insert_not_pending
206
- ---------------------------------------------------------
207
-  (0.1ms) rollback transaction
208
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
44
+  (0.5ms) rollback transaction
209
45
   (0.1ms) begin transaction
210
- --------------------------------------------------------
211
- BulkInsertWorkerTest: test_save!_inserts_pending_records
212
- --------------------------------------------------------
213
-  (0.1ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") ('Yo',15,'f',NULL,NULL),('Hello',25,'t',NULL,NULL)
214
- SQLite3::SQLException: near "(": syntax error: INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") ('Yo',15,'f',NULL,NULL),('Hello',25,'t',NULL,NULL)
215
-  (0.0ms) rollback transaction
216
-  (0.1ms) begin transaction
217
- ------------------------------------------------------
218
- BulkInsertWorkerTest: test_empty_insert_is_not_pending
219
- ------------------------------------------------------
220
-  (0.0ms) rollback transaction
221
-  (0.1ms) begin transaction
222
- --------------------------------------------------------------------
223
- BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
224
- --------------------------------------------------------------------
225
-  (0.0ms) rollback transaction
46
+ ----------------------------------------------------------------------------------
47
+ BulkInsertWorkerTest: test_add_should_save_automatically_when_overflowing_set_size
48
+ ----------------------------------------------------------------------------------
49
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","color","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-28 19:58:04.065706','2015-10-28 19:58:04.065706','2015-10-28 19:58:04.065732')
50
+  (0.0ms) SELECT COUNT(*) FROM "testings"
51
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
52
+  (0.4ms) rollback transaction
226
53
   (0.1ms) begin transaction
227
54
  -------------------------------------------------------------------
228
55
  BulkInsertWorkerTest: test_save!_when_not_pending_should_do_nothing
229
56
  -------------------------------------------------------------------
230
57
   (0.1ms) SELECT COUNT(*) FROM "testings"
231
-  (0.0ms) SELECT COUNT(*) FROM "testings"
232
-  (0.0ms) rollback transaction
233
-  (0.1ms) begin transaction
234
- ---------------------------------------------------------
235
- BulkInsertWorkerTest: test_save!_makes_insert_not_pending
236
- ---------------------------------------------------------
237
-  (0.1ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") ('Hello',15,'t',NULL,NULL)
238
- SQLite3::SQLException: near "(": syntax error: INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") ('Hello',15,'t',NULL,NULL)
239
-  (0.1ms) rollback transaction
240
-  (0.0ms) begin transaction
241
- --------------------------
242
- BulkInsertTest: test_truth
243
- --------------------------
244
-  (0.1ms) rollback transaction
245
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
246
-  (0.1ms) begin transaction
247
- --------------------------------------------------------
248
- BulkInsertWorkerTest: test_save!_inserts_pending_records
249
- --------------------------------------------------------
250
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Yo',15,'f',NULL,NULL),('Hello',25,'t',NULL,NULL)
251
- SQLite3::ConstraintException: NOT NULL constraint failed: testings.created_at: INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Yo',15,'f',NULL,NULL),('Hello',25,'t',NULL,NULL)
252
-  (0.1ms) rollback transaction
253
-  (0.1ms) begin transaction
254
- --------------------------------------------------------------------
255
- BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
256
- --------------------------------------------------------------------
58
+  (0.1ms) SELECT COUNT(*) FROM "testings"
257
59
   (0.1ms) rollback transaction
60
+  (0.0ms) begin transaction
61
+ -------------------------------------------------------------------------------
62
+ BulkInsertWorkerTest: test_add_should_default_timestamp_columns_to_current_time
63
+ -------------------------------------------------------------------------------
64
+  (0.4ms) INSERT INTO "testings" ("greeting","age","happy","color","created_at","updated_at") VALUES ('Hello',15,'t','chartreuse','2015-10-28 19:58:04.071406','2015-10-28 19:58:04.071406')
65
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
66
+  (0.4ms) rollback transaction
258
67
   (0.1ms) begin transaction
259
- ------------------------------------------------------
260
- BulkInsertWorkerTest: test_empty_insert_is_not_pending
261
- ------------------------------------------------------
262
-  (0.0ms) rollback transaction
263
-  (0.1ms) begin transaction
264
- ---------------------------------------------------------
265
- BulkInsertWorkerTest: test_save!_makes_insert_not_pending
266
- ---------------------------------------------------------
267
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t',NULL,NULL)
268
- SQLite3::ConstraintException: NOT NULL constraint failed: testings.created_at: INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t',NULL,NULL)
269
-  (0.1ms) rollback transaction
270
-  (0.1ms) begin transaction
271
- -------------------------------------------------------------------
272
- BulkInsertWorkerTest: test_save!_when_not_pending_should_do_nothing
273
- -------------------------------------------------------------------
274
-  (0.0ms) SELECT COUNT(*) FROM "testings"
275
-  (0.0ms) SELECT COUNT(*) FROM "testings"
276
-  (0.0ms) rollback transaction
277
-  (0.0ms) begin transaction
278
- --------------------------
279
- BulkInsertTest: test_truth
280
- --------------------------
281
-  (0.0ms) rollback transaction
282
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
283
-  (0.1ms) begin transaction
284
- -------------------------------------------------------------------
285
- BulkInsertWorkerTest: test_save!_when_not_pending_should_do_nothing
286
- -------------------------------------------------------------------
287
-  (0.1ms) SELECT COUNT(*) FROM "testings"
288
-  (0.1ms) SELECT COUNT(*) FROM "testings"
289
-  (0.0ms) rollback transaction
290
-  (0.0ms) begin transaction
291
- ------------------------------------------------------
292
- BulkInsertWorkerTest: test_empty_insert_is_not_pending
293
- ------------------------------------------------------
294
-  (0.0ms) rollback transaction
295
-  (0.1ms) begin transaction
296
- --------------------------------------------------------
297
- BulkInsertWorkerTest: test_save!_inserts_pending_records
298
- --------------------------------------------------------
299
-  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Yo',15,'f','2015-10-08 18:29:58.915692','2015-10-08 18:29:58.915692'),('Hello',25,'t','2015-10-08 18:29:58.915692','2015-10-08 18:29:58.915692')
300
- Testing Load (0.1ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
301
- Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
302
-  (2.6ms) rollback transaction
68
+ ------------------------------------------------------------------------------
69
+ BulkInsertWorkerTest: test_add_should_use_database_default_values_when_present
70
+ ------------------------------------------------------------------------------
71
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","color","created_at","updated_at") VALUES ('Hello',20,'f','chartreuse','2015-10-28 19:58:04.074184','2015-10-28 19:58:04.074184')
72
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
73
+  (0.4ms) rollback transaction
303
74
   (0.1ms) begin transaction
304
75
  ---------------------------------------------------------
305
76
  BulkInsertWorkerTest: test_save!_makes_insert_not_pending
306
77
  ---------------------------------------------------------
307
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-08 18:29:58.929152','2015-10-08 18:29:58.929152')
78
+  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","color","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-28 19:58:04.076665','2015-10-28 19:58:04.076665','2015-10-28 19:58:04.076706')
308
79
   (0.4ms) rollback transaction
309
80
   (0.1ms) begin transaction
310
- --------------------------------------------------------------------
311
- BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
312
- --------------------------------------------------------------------
313
-  (0.0ms) rollback transaction
314
-  (0.0ms) begin transaction
315
- --------------------------
316
- BulkInsertTest: test_truth
317
- --------------------------
318
-  (0.0ms) rollback transaction
319
- ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
81
+ ----------------------------------------------------------------------------------------------
82
+ BulkInsertWorkerTest: test_default_timestamp_columns_should_be_equivalent_for_the_entire_batch
83
+ ----------------------------------------------------------------------------------------------
84
+  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","color","created_at","updated_at") VALUES ('Hello',15,'t','chartreuse','2015-10-28 19:58:04.079884','2015-10-28 19:58:04.079884'),('Howdy',20,'f','chartreuse','2015-10-28 19:58:04.079884','2015-10-28 19:58:04.079884')
85
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings"
86
+  (0.4ms) rollback transaction
320
87
   (0.1ms) begin transaction
321
- --------------------------
322
- BulkInsertTest: test_truth
323
- --------------------------
324
-  (0.0ms) rollback transaction
325
-  (0.0ms) begin transaction
326
- -------------------------------------------------------------------
327
- BulkInsertWorkerTest: test_save!_when_not_pending_should_do_nothing
328
- -------------------------------------------------------------------
329
-  (0.4ms) SELECT COUNT(*) FROM "testings"
330
-  (0.1ms) SELECT COUNT(*) FROM "testings"
331
-  (0.1ms) rollback transaction
88
+ ----------------------------------------------------------------
89
+ BulkInsertWorkerTest: test_add_should_allow_values_given_as_Hash
90
+ ----------------------------------------------------------------
91
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","color","created_at","updated_at") VALUES ('Yo',20,'f','chartreuse','2015-10-28 19:58:04.082441','2015-10-28 19:58:04.082441')
92
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
93
+  (0.4ms) rollback transaction
332
94
   (0.1ms) begin transaction
333
95
  --------------------------------------------------------------------
334
96
  BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
335
97
  --------------------------------------------------------------------
336
98
   (0.0ms) rollback transaction
337
99
   (0.1ms) begin transaction
338
- ---------------------------------------------------------
339
- BulkInsertWorkerTest: test_save!_makes_insert_not_pending
340
- ---------------------------------------------------------
341
-  (0.8ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-08 18:33:07.278653','2015-10-08 18:33:07.278653')
342
-  (0.4ms) rollback transaction
343
-  (0.0ms) begin transaction
344
100
  ------------------------------------------------------
345
101
  BulkInsertWorkerTest: test_empty_insert_is_not_pending
346
102
  ------------------------------------------------------
347
-  (0.1ms) rollback transaction
348
-  (0.0ms) begin transaction
349
- -------------------------------------------------------------------------------
350
- BulkInsertWorkerTest: test_add_should_default_timestamp_columns_to_current_time
351
- -------------------------------------------------------------------------------
352
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t',NULL,NULL)
353
- SQLite3::ConstraintException: NOT NULL constraint failed: testings.created_at: INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t',NULL,NULL)
354
-  (0.1ms) rollback transaction
355
-  (0.1ms) begin transaction
356
- --------------------------------------------------------
357
- BulkInsertWorkerTest: test_save!_inserts_pending_records
358
- --------------------------------------------------------
359
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Yo',15,'f','2015-10-08 18:33:07.284559','2015-10-08 18:33:07.284559'),('Hello',25,'t','2015-10-08 18:33:07.284559','2015-10-08 18:33:07.284559')
360
- Testing Load (0.2ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
361
- Testing Load (0.1ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
362
-  (0.5ms) rollback transaction
363
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
364
-  (0.1ms) begin transaction
365
- --------------------------------------------------------------------
366
- BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
367
- --------------------------------------------------------------------
368
103
   (0.0ms) rollback transaction
369
104
   (0.1ms) begin transaction
370
- -------------------------------------------------------------------------------
371
- BulkInsertWorkerTest: test_add_should_default_timestamp_columns_to_current_time
372
- -------------------------------------------------------------------------------
373
-  (0.5ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-08 18:35:57.135857','2015-10-08 18:35:57.135859')
105
+ ----------------------------------------------------------------
106
+ BulkInsertWorkerTest: test_explicit_nil_should_override_defaults
107
+ ----------------------------------------------------------------
108
+  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","color","created_at","updated_at") VALUES ('Hello',20,'f',NULL,'2015-10-28 19:58:04.085934','2015-10-28 19:58:04.085934')
374
109
  Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
375
110
   (0.5ms) rollback transaction
376
111
   (0.1ms) begin transaction
377
- ------------------------------------------------------
378
- BulkInsertWorkerTest: test_empty_insert_is_not_pending
379
- ------------------------------------------------------
380
-  (0.0ms) rollback transaction
381
-  (0.1ms) begin transaction
382
- --------------------------------------------------------
383
- BulkInsertWorkerTest: test_save!_inserts_pending_records
384
- --------------------------------------------------------
385
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Yo',15,'f','2015-10-08 18:35:57.146754','2015-10-08 18:35:57.146754'),('Hello',25,'t','2015-10-08 18:35:57.146754','2015-10-08 18:35:57.146754')
386
- Testing Load (0.2ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
387
- Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
388
-  (0.5ms) rollback transaction
389
-  (0.1ms) begin transaction
390
- -------------------------------------------------------------------
391
- BulkInsertWorkerTest: test_save!_when_not_pending_should_do_nothing
392
- -------------------------------------------------------------------
393
-  (0.1ms) SELECT COUNT(*) FROM "testings"
394
-  (0.0ms) SELECT COUNT(*) FROM "testings"
395
-  (0.0ms) rollback transaction
396
-  (0.1ms) begin transaction
397
- ---------------------------------------------------------
398
- BulkInsertWorkerTest: test_save!_makes_insert_not_pending
399
- ---------------------------------------------------------
400
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-08 18:35:57.153949','2015-10-08 18:35:57.153949')
401
-  (0.4ms) rollback transaction
402
-  (0.0ms) begin transaction
403
- --------------------------
404
- BulkInsertTest: test_truth
405
- --------------------------
112
+ -------------------------------------------
113
+ BulkInsertWorkerTest: test_default_set_size
114
+ -------------------------------------------
406
115
   (0.1ms) rollback transaction
407
116
  ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
408
117
   (0.1ms) begin transaction
409
- --------------------------
410
- BulkInsertTest: test_truth
411
- --------------------------
118
+ ------------------------------------------------------------------------------
119
+ BulkInsertTest: test_default_bulk_columns_should_return_all_columns_without_id
120
+ ------------------------------------------------------------------------------
412
121
   (0.0ms) rollback transaction
413
-  (0.0ms) begin transaction
414
- ------------------------------------------------------
415
- BulkInsertWorkerTest: test_empty_insert_is_not_pending
416
- ------------------------------------------------------
122
+  (0.1ms) begin transaction
123
+ -------------------------------------------------------------------
124
+ BulkInsertTest: test_bulk_insert_without_block_should_return_worker
125
+ -------------------------------------------------------------------
417
126
   (0.0ms) rollback transaction
418
127
   (0.0ms) begin transaction
419
- --------------------------------------------------------
420
- BulkInsertWorkerTest: test_save!_inserts_pending_records
421
- --------------------------------------------------------
422
-  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Yo',15,'f','2015-10-08 18:37:28.549901','2015-10-08 18:37:28.549901'),('Hello',25,'t','2015-10-08 18:37:28.549901','2015-10-08 18:37:28.549901')
423
- Testing Load (0.4ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
424
- Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
425
-  (2.5ms) rollback transaction
128
+ ---------------------------------------------------------------------
129
+ BulkInsertTest: test_bulk_insert_with_block_should_save_automatically
130
+ ---------------------------------------------------------------------
131
+  (0.1ms) SELECT COUNT(*) FROM "testings"
132
+  (0.0ms) SAVEPOINT active_record_1
133
+  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',NULL,NULL,'2015-10-28 20:01:54.280213','2015-10-28 20:01:54.280213','chartreuse')
134
+  (0.1ms) RELEASE SAVEPOINT active_record_1
135
+  (0.1ms) SELECT COUNT(*) FROM "testings"
136
+  (1.8ms) rollback transaction
426
137
   (0.1ms) begin transaction
138
+ ---------------------------------------------------------------
139
+ BulkInsertTest: test_bulk_insert_with_block_should_yield_worker
140
+ ---------------------------------------------------------------
141
+  (0.0ms) SAVEPOINT active_record_1
142
+  (0.0ms) RELEASE SAVEPOINT active_record_1
143
+  (0.0ms) rollback transaction
144
+  (0.0ms) begin transaction
145
+ ----------------------------------------------------------------------------------------------
146
+ BulkInsertWorkerTest: test_default_timestamp_columns_should_be_equivalent_for_the_entire_batch
147
+ ----------------------------------------------------------------------------------------------
148
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","color","created_at","updated_at") VALUES ('Hello',15,'t','chartreuse','2015-10-28 20:01:54.287981','2015-10-28 20:01:54.287981'),('Howdy',20,'f','chartreuse','2015-10-28 20:01:54.287981','2015-10-28 20:01:54.287981')
149
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings"
150
+  (0.5ms) rollback transaction
151
+  (0.1ms) begin transaction
152
+ ------------------------------------------------------------------------------
153
+ BulkInsertWorkerTest: test_add_should_use_database_default_values_when_present
154
+ ------------------------------------------------------------------------------
155
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","color","created_at","updated_at") VALUES ('Hello',20,'f','chartreuse','2015-10-28 20:01:54.304735','2015-10-28 20:01:54.304735')
156
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
157
+  (0.4ms) rollback transaction
158
+  (0.0ms) begin transaction
427
159
  --------------------------------------------------------------------
428
160
  BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
429
161
  --------------------------------------------------------------------
430
162
   (0.0ms) rollback transaction
431
163
   (0.1ms) begin transaction
432
- -------------------------------------------------------------------
433
- BulkInsertWorkerTest: test_save!_when_not_pending_should_do_nothing
434
- -------------------------------------------------------------------
435
-  (0.1ms) SELECT COUNT(*) FROM "testings"
164
+ ----------------------------------------------------------------------------------
165
+ BulkInsertWorkerTest: test_add_should_save_automatically_when_overflowing_set_size
166
+ ----------------------------------------------------------------------------------
167
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","color","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-28 20:01:54.308089','2015-10-28 20:01:54.308089','2015-10-28 20:01:54.308108')
436
168
   (0.1ms) SELECT COUNT(*) FROM "testings"
437
-  (0.0ms) rollback transaction
438
-  (0.0ms) begin transaction
439
- -------------------------------------------------------------------------------
440
- BulkInsertWorkerTest: test_add_should_default_timestamp_columns_to_current_time
441
- -------------------------------------------------------------------------------
442
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-08 18:37:28.568038','2015-10-08 18:37:28.568039')
443
- Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
444
-  (0.5ms) rollback transaction
445
-  (0.0ms) begin transaction
446
- ---------------------------------------------------------
447
- BulkInsertWorkerTest: test_save!_makes_insert_not_pending
448
- ---------------------------------------------------------
449
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-08 18:37:28.570308','2015-10-08 18:37:28.570308')
450
-  (0.4ms) rollback transaction
451
-  (0.1ms) begin transaction
452
- ----------------------------------------------------------------
453
- BulkInsertWorkerTest: test_add_should_allow_values_given_as_Hash
454
- ----------------------------------------------------------------
455
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('---
456
- - :greeting
457
- - Yo
458
- ',NULL,'---
459
- - :happy
460
- - false
461
- ','2015-10-08 18:37:28.571770','2015-10-08 18:37:28.571771')
462
169
  Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
463
170
   (0.9ms) rollback transaction
464
- ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
465
-  (0.1ms) begin transaction
466
- --------------------------
467
- BulkInsertTest: test_truth
468
- --------------------------
469
-  (0.0ms) rollback transaction
470
-  (0.0ms) begin transaction
471
- --------------------------------------------------------
472
- BulkInsertWorkerTest: test_save!_inserts_pending_records
473
- --------------------------------------------------------
474
-  (1.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Yo',15,'f','2015-10-08 18:39:27.624826','2015-10-08 18:39:27.624826'),('Hello',25,'t','2015-10-08 18:39:27.624826','2015-10-08 18:39:27.624826')
475
- Testing Load (0.2ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
476
- Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
477
-  (0.5ms) rollback transaction
478
-  (0.1ms) begin transaction
479
- ---------------------------------------------------------
480
- BulkInsertWorkerTest: test_save!_makes_insert_not_pending
481
- ---------------------------------------------------------
482
-  (0.4ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-08 18:39:27.639732','2015-10-08 18:39:27.639732')
483
-  (0.6ms) rollback transaction
484
-  (0.1ms) begin transaction
485
- -------------------------------------------------------------------
486
- BulkInsertWorkerTest: test_save!_when_not_pending_should_do_nothing
487
- -------------------------------------------------------------------
488
-  (0.1ms) SELECT COUNT(*) FROM "testings"
489
-  (0.0ms) SELECT COUNT(*) FROM "testings"
490
-  (0.0ms) rollback transaction
491
171
   (0.1ms) begin transaction
492
172
  ------------------------------------------------------
493
173
  BulkInsertWorkerTest: test_empty_insert_is_not_pending
494
174
  ------------------------------------------------------
495
175
   (0.1ms) rollback transaction
496
-  (0.1ms) begin transaction
497
- ----------------------------------------------------------------
498
- BulkInsertWorkerTest: test_add_should_allow_values_given_as_Hash
499
- ----------------------------------------------------------------
500
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Yo',20,'f','2015-10-08 18:39:27.644450','2015-10-08 18:39:27.644452')
501
- Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
502
-  (0.5ms) rollback transaction
176
+  (0.0ms) begin transaction
177
+ -------------------------------------------
178
+ BulkInsertWorkerTest: test_default_set_size
179
+ -------------------------------------------
180
+  (0.0ms) rollback transaction
503
181
   (0.1ms) begin transaction
504
182
  -------------------------------------------------------------------------------
505
183
  BulkInsertWorkerTest: test_add_should_default_timestamp_columns_to_current_time
506
184
  -------------------------------------------------------------------------------
507
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-08 18:39:27.646591','2015-10-08 18:39:27.646592')
508
- Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
185
+  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","color","created_at","updated_at") VALUES ('Hello',15,'t','chartreuse','2015-10-28 20:01:54.313502','2015-10-28 20:01:54.313502')
186
+ Testing Load (0.2ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
509
187
   (0.4ms) rollback transaction
510
188
   (0.1ms) begin transaction
511
- --------------------------------------------------------------------
512
- BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
513
- --------------------------------------------------------------------
514
-  (0.0ms) rollback transaction
515
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
516
-  (0.1ms) begin transaction
517
- --------------------------
518
- BulkInsertTest: test_truth
519
- --------------------------
520
-  (0.0ms) rollback transaction
521
-  (0.0ms) begin transaction
522
- ----------------------------------------------------------------------------------
523
- BulkInsertWorkerTest: test_add_should_save_automatically_when_overflowing_set_size
524
- ----------------------------------------------------------------------------------
525
-  (0.1ms) rollback transaction
526
-  (0.1ms) begin transaction
527
189
  ---------------------------------------------------------
528
190
  BulkInsertWorkerTest: test_save!_makes_insert_not_pending
529
191
  ---------------------------------------------------------
530
-  (0.7ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-08 18:41:08.257815','2015-10-08 18:41:08.257815')
531
-  (2.2ms) rollback transaction
532
-  (0.1ms) begin transaction
533
- --------------------------------------------------------------------
534
- BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
535
- --------------------------------------------------------------------
536
-  (0.0ms) rollback transaction
192
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","color","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-28 20:01:54.316472','2015-10-28 20:01:54.316472','2015-10-28 20:01:54.316496')
193
+  (0.3ms) rollback transaction
537
194
   (0.1ms) begin transaction
538
195
  -------------------------------------------------------------------
539
196
  BulkInsertWorkerTest: test_save!_when_not_pending_should_do_nothing
540
197
  -------------------------------------------------------------------
541
-  (0.1ms) SELECT COUNT(*) FROM "testings"
542
-  (0.0ms) SELECT COUNT(*) FROM "testings"
198
+  (0.5ms) SELECT COUNT(*) FROM "testings"
199
+  (0.1ms) SELECT COUNT(*) FROM "testings"
543
200
   (0.1ms) rollback transaction
544
-  (0.0ms) begin transaction
545
- --------------------------------------------------------
546
- BulkInsertWorkerTest: test_save!_inserts_pending_records
547
- --------------------------------------------------------
548
-  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Yo',15,'f','2015-10-08 18:41:08.267944','2015-10-08 18:41:08.267944'),('Hello',25,'t','2015-10-08 18:41:08.267944','2015-10-08 18:41:08.267944')
549
- Testing Load (0.2ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
550
- Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
551
-  (0.7ms) rollback transaction
552
-  (0.1ms) begin transaction
553
- ------------------------------------------------------
554
- BulkInsertWorkerTest: test_empty_insert_is_not_pending
555
- ------------------------------------------------------
556
-  (0.0ms) rollback transaction
557
-  (0.1ms) begin transaction
558
- -------------------------------------------------------------------------------
559
- BulkInsertWorkerTest: test_add_should_default_timestamp_columns_to_current_time
560
- -------------------------------------------------------------------------------
561
-  (0.4ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-08 18:41:08.280089','2015-10-08 18:41:08.280093')
562
- Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
563
-  (0.6ms) rollback transaction
564
-  (0.1ms) begin transaction
201
+  (0.1ms) begin transaction
565
202
  ----------------------------------------------------------------
566
203
  BulkInsertWorkerTest: test_add_should_allow_values_given_as_Hash
567
204
  ----------------------------------------------------------------
568
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Yo',20,'f','2015-10-08 18:41:08.283648','2015-10-08 18:41:08.283648')
569
- Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
570
-  (0.5ms) rollback transaction
571
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
572
-  (0.1ms) begin transaction
573
- --------------------------------------------------------
574
- BulkInsertWorkerTest: test_save!_inserts_pending_records
575
- --------------------------------------------------------
576
-  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Yo',15,'f','2015-10-08 18:41:32.845485','2015-10-08 18:41:32.845485'),('Hello',25,'t','2015-10-08 18:41:32.845485','2015-10-08 18:41:32.845485')
577
- Testing Load (0.1ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
578
- Testing Load (0.1ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
579
-  (2.0ms) rollback transaction
580
-  (0.1ms) begin transaction
581
- ------------------------------------------------------
582
- BulkInsertWorkerTest: test_empty_insert_is_not_pending
583
- ------------------------------------------------------
584
-  (0.0ms) rollback transaction
585
-  (0.1ms) begin transaction
586
- -------------------------------------------------------------------------------
587
- BulkInsertWorkerTest: test_add_should_default_timestamp_columns_to_current_time
588
- -------------------------------------------------------------------------------
589
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-08 18:41:32.862870','2015-10-08 18:41:32.862872')
205
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","color","created_at","updated_at") VALUES ('Yo',20,'f','chartreuse','2015-10-28 20:01:54.320417','2015-10-28 20:01:54.320417')
590
206
  Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
591
-  (0.5ms) rollback transaction
592
-  (0.0ms) begin transaction
593
- --------------------------------------------------------------------
594
- BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
595
- --------------------------------------------------------------------
596
-  (0.0ms) rollback transaction
207
+  (0.4ms) rollback transaction
597
208
   (0.1ms) begin transaction
598
209
  ----------------------------------------------------------------
599
- BulkInsertWorkerTest: test_add_should_allow_values_given_as_Hash
210
+ BulkInsertWorkerTest: test_explicit_nil_should_override_defaults
600
211
  ----------------------------------------------------------------
601
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Yo',20,'f','2015-10-08 18:41:32.865967','2015-10-08 18:41:32.865967')
212
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","color","created_at","updated_at") VALUES ('Hello',20,'f',NULL,'2015-10-28 20:01:54.322459','2015-10-28 20:01:54.322459')
602
213
  Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
603
-  (0.3ms) rollback transaction
214
+  (0.4ms) rollback transaction
215
+  (0.1ms) begin transaction
216
+ --------------------------------------------------------
217
+ BulkInsertWorkerTest: test_save!_inserts_pending_records
218
+ --------------------------------------------------------
219
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","color","created_at","updated_at") VALUES ('Yo',15,'f','2015-10-28 20:01:54.324109','2015-10-28 20:01:54.324109','2015-10-28 20:01:54.324131'),('Hello',25,'t','2015-10-28 20:01:54.324109','2015-10-28 20:01:54.324109','2015-10-28 20:01:54.324131')
220
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
221
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
222
+  (0.5ms) rollback transaction
223
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
224
+  (0.1ms) begin transaction
225
+ ---------------------------------------------------------------------
226
+ BulkInsertTest: test_bulk_insert_with_block_should_save_automatically
227
+ ---------------------------------------------------------------------
228
+  (0.1ms) SELECT COUNT(*) FROM "testings"
229
+  (0.0ms) SAVEPOINT active_record_1
230
+  (0.5ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',NULL,NULL,'2015-10-28 20:04:24.830190','2015-10-28 20:04:24.830190','chartreuse')
231
+  (0.0ms) RELEASE SAVEPOINT active_record_1
232
+  (0.1ms) SELECT COUNT(*) FROM "testings"
233
+  (1.9ms) rollback transaction
604
234
   (0.1ms) begin transaction
605
235
  -------------------------------------------------------------------
606
- BulkInsertWorkerTest: test_save!_when_not_pending_should_do_nothing
236
+ BulkInsertTest: test_bulk_insert_without_block_should_return_worker
607
237
  -------------------------------------------------------------------
608
-  (0.0ms) SELECT COUNT(*) FROM "testings"
609
-  (0.0ms) SELECT COUNT(*) FROM "testings"
610
238
   (0.0ms) rollback transaction
611
239
   (0.1ms) begin transaction
612
- ---------------------------------------------------------
613
- BulkInsertWorkerTest: test_save!_makes_insert_not_pending
614
- ---------------------------------------------------------
615
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-08 18:41:32.869268','2015-10-08 18:41:32.869268')
616
-  (0.4ms) rollback transaction
617
-  (0.1ms) begin transaction
618
- ----------------------------------------------------------------------------------
619
- BulkInsertWorkerTest: test_add_should_save_automatically_when_overflowing_set_size
620
- ----------------------------------------------------------------------------------
621
-  (0.1ms) SELECT COUNT(*) FROM "testings"
240
+ ------------------------------------------------------------------------------
241
+ BulkInsertTest: test_default_bulk_columns_should_return_all_columns_without_id
242
+ ------------------------------------------------------------------------------
243
+  (0.0ms) rollback transaction
244
+  (0.0ms) begin transaction
245
+ ---------------------------------------------------------------
246
+ BulkInsertTest: test_bulk_insert_with_block_should_yield_worker
247
+ ---------------------------------------------------------------
248
+  (0.0ms) SAVEPOINT active_record_1
249
+  (0.0ms) RELEASE SAVEPOINT active_record_1
250
+  (0.0ms) rollback transaction
251
+  (0.1ms) begin transaction
252
+ -----------------------------------------------------------------------------
253
+ BulkInsertTest: test_bulk_insert_with_array_should_save_the_array_immediately
254
+ -----------------------------------------------------------------------------
255
+  (0.1ms) SELECT COUNT(*) FROM "testings"
256
+  (0.2ms) SELECT COUNT(*) FROM "testings"
622
257
   (0.0ms) rollback transaction
623
258
   (0.0ms) begin transaction
624
- --------------------------
625
- BulkInsertTest: test_truth
626
- --------------------------
627
-  (0.1ms) rollback transaction
628
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
629
-  (0.1ms) begin transaction
630
- --------------------------
631
- BulkInsertTest: test_truth
632
- --------------------------
633
-  (0.1ms) rollback transaction
634
-  (0.0ms) begin transaction
635
- -------------------------------------------------------------------
636
- BulkInsertWorkerTest: test_save!_when_not_pending_should_do_nothing
637
- -------------------------------------------------------------------
638
-  (0.1ms) SELECT COUNT(*) FROM "testings"
639
-  (0.0ms) SELECT COUNT(*) FROM "testings"
640
-  (0.0ms) rollback transaction
641
-  (0.0ms) begin transaction
642
- --------------------------------------------------------
643
- BulkInsertWorkerTest: test_save!_inserts_pending_records
644
- --------------------------------------------------------
645
-  (0.0ms) rollback transaction
646
-  (0.1ms) begin transaction
647
- ------------------------------------------------------
648
- BulkInsertWorkerTest: test_empty_insert_is_not_pending
649
- ------------------------------------------------------
650
-  (0.1ms) rollback transaction
651
-  (0.1ms) begin transaction
652
- ---------------------------------------------------------
653
- BulkInsertWorkerTest: test_save!_makes_insert_not_pending
654
- ---------------------------------------------------------
655
-  (0.0ms) rollback transaction
656
-  (0.0ms) begin transaction
657
259
  ----------------------------------------------------------------
658
260
  BulkInsertWorkerTest: test_add_should_allow_values_given_as_Hash
659
261
  ----------------------------------------------------------------
660
-  (0.0ms) rollback transaction
661
-  (0.1ms) begin transaction
662
- -------------------------------------------------------------------------------
663
- BulkInsertWorkerTest: test_add_should_default_timestamp_columns_to_current_time
664
- -------------------------------------------------------------------------------
665
-  (0.0ms) rollback transaction
666
-  (0.1ms) begin transaction
667
- ----------------------------------------------------------------------------------
668
- BulkInsertWorkerTest: test_add_should_save_automatically_when_overflowing_set_size
669
- ----------------------------------------------------------------------------------
670
-  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-08 18:41:59.387919','2015-10-08 18:41:59.387919')
671
-  (0.0ms) SELECT COUNT(*) FROM "testings"
262
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","color","created_at","updated_at") VALUES ('Yo',20,'f','chartreuse','2015-10-28 20:04:24.840586','2015-10-28 20:04:24.840586')
672
263
  Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
673
-  (1.9ms) rollback transaction
264
+  (0.5ms) rollback transaction
674
265
   (0.1ms) begin transaction
675
266
  --------------------------------------------------------------------
676
267
  BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
677
268
  --------------------------------------------------------------------
678
-  (0.1ms) rollback transaction
679
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
680
-  (0.1ms) begin transaction
681
- ----------------------------------------------------------------------------------
682
- BulkInsertWorkerTest: test_add_should_save_automatically_when_overflowing_set_size
683
- ----------------------------------------------------------------------------------
684
-  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-08 18:42:13.466211','2015-10-08 18:42:13.466211')
685
-  (0.0ms) SELECT COUNT(*) FROM "testings"
686
- Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
687
-  (2.0ms) rollback transaction
269
+  (0.0ms) rollback transaction
270
+  (0.1ms) begin transaction
271
+ -------------------------------------------
272
+ BulkInsertWorkerTest: test_default_set_size
273
+ -------------------------------------------
274
+  (0.0ms) rollback transaction
688
275
   (0.1ms) begin transaction
689
- ---------------------------------------------------------
690
- BulkInsertWorkerTest: test_save!_makes_insert_not_pending
691
- ---------------------------------------------------------
692
-  (0.4ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-08 18:42:13.477072','2015-10-08 18:42:13.477072')
693
-  (0.4ms) rollback transaction
694
-  (0.1ms) begin transaction
695
276
  -------------------------------------------------------------------------------
696
277
  BulkInsertWorkerTest: test_add_should_default_timestamp_columns_to_current_time
697
278
  -------------------------------------------------------------------------------
698
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-08 18:42:13.479323','2015-10-08 18:42:13.479325')
699
- Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
700
-  (0.5ms) rollback transaction
701
-  (0.1ms) begin transaction
279
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","color","created_at","updated_at") VALUES ('Hello',15,'t','chartreuse','2015-10-28 20:04:24.851291','2015-10-28 20:04:24.851291')
280
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
281
+  (0.4ms) rollback transaction
282
+  (0.1ms) begin transaction
702
283
  --------------------------------------------------------
703
284
  BulkInsertWorkerTest: test_save!_inserts_pending_records
704
285
  --------------------------------------------------------
705
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Yo',15,'f','2015-10-08 18:42:13.481608','2015-10-08 18:42:13.481608'),('Hello',25,'t','2015-10-08 18:42:13.481608','2015-10-08 18:42:13.481608')
706
- Testing Load (0.1ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
707
- Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
708
-  (0.6ms) rollback transaction
709
-  (0.1ms) begin transaction
710
- --------------------------------------------------------------------
711
- BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
712
- --------------------------------------------------------------------
713
-  (0.0ms) rollback transaction
714
-  (0.1ms) begin transaction
286
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","color","created_at","updated_at") VALUES ('Yo',15,'f','2015-10-28 20:04:24.853653','2015-10-28 20:04:24.853653','2015-10-28 20:04:24.853678'),('Hello',25,'t','2015-10-28 20:04:24.853653','2015-10-28 20:04:24.853653','2015-10-28 20:04:24.853678')
287
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
288
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
289
+  (0.5ms) rollback transaction
290
+  (0.1ms) begin transaction
715
291
  ------------------------------------------------------
716
292
  BulkInsertWorkerTest: test_empty_insert_is_not_pending
717
293
  ------------------------------------------------------
718
-  (0.1ms) rollback transaction
719
-  (0.2ms) begin transaction
294
+  (1.3ms) rollback transaction
295
+  (0.1ms) begin transaction
296
+ ------------------------------------------------------------------------------
297
+ BulkInsertWorkerTest: test_add_should_use_database_default_values_when_present
298
+ ------------------------------------------------------------------------------
299
+  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","color","created_at","updated_at") VALUES ('Hello',20,'f','chartreuse','2015-10-28 20:04:24.862415','2015-10-28 20:04:24.862415')
300
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
301
+  (0.4ms) rollback transaction
302
+  (0.1ms) begin transaction
720
303
  ----------------------------------------------------------------
721
- BulkInsertWorkerTest: test_add_should_allow_values_given_as_Hash
304
+ BulkInsertWorkerTest: test_explicit_nil_should_override_defaults
722
305
  ----------------------------------------------------------------
723
-  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Yo',20,'f','2015-10-08 18:42:13.489269','2015-10-08 18:42:13.489269')
306
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","color","created_at","updated_at") VALUES ('Hello',20,'f',NULL,'2015-10-28 20:04:24.864939','2015-10-28 20:04:24.864939')
307
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
308
+  (0.4ms) rollback transaction
309
+  (0.1ms) begin transaction
310
+ ----------------------------------------------------------------------------------
311
+ BulkInsertWorkerTest: test_add_should_save_automatically_when_overflowing_set_size
312
+ ----------------------------------------------------------------------------------
313
+  (0.8ms) INSERT INTO "testings" ("greeting","age","happy","color","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-28 20:04:24.867103','2015-10-28 20:04:24.867103','2015-10-28 20:04:24.867135')
314
+  (0.1ms) SELECT COUNT(*) FROM "testings"
724
315
  Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
725
316
   (0.4ms) rollback transaction
726
317
   (0.1ms) begin transaction
@@ -728,26 +319,43 @@ BulkInsertWorkerTest: test_add_should_allow_values_given_as_Hash
728
319
  BulkInsertWorkerTest: test_save!_when_not_pending_should_do_nothing
729
320
  -------------------------------------------------------------------
730
321
   (0.1ms) SELECT COUNT(*) FROM "testings"
731
-  (0.0ms) SELECT COUNT(*) FROM "testings"
732
-  (0.0ms) rollback transaction
733
-  (0.0ms) begin transaction
734
- --------------------------
735
- BulkInsertTest: test_truth
736
- --------------------------
322
+  (0.1ms) SELECT COUNT(*) FROM "testings"
737
323
   (0.1ms) rollback transaction
738
- ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
739
-  (0.1ms) begin transaction
740
- --------------------------
741
- BulkInsertTest: test_truth
742
- --------------------------
743
-  (0.1ms) rollback transaction
324
+  (0.1ms) begin transaction
325
+ ---------------------------------------------------------
326
+ BulkInsertWorkerTest: test_save!_makes_insert_not_pending
327
+ ---------------------------------------------------------
328
+  (0.4ms) INSERT INTO "testings" ("greeting","age","happy","color","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-28 20:04:24.873964','2015-10-28 20:04:24.873964','2015-10-28 20:04:24.874001')
329
+  (0.4ms) rollback transaction
744
330
   (0.0ms) begin transaction
331
+ ----------------------------------------------------------------------------------------------
332
+ BulkInsertWorkerTest: test_default_timestamp_columns_should_be_equivalent_for_the_entire_batch
333
+ ----------------------------------------------------------------------------------------------
334
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","color","created_at","updated_at") VALUES ('Hello',15,'t','chartreuse','2015-10-28 20:04:24.876104','2015-10-28 20:04:24.876104'),('Howdy',20,'f','chartreuse','2015-10-28 20:04:24.876104','2015-10-28 20:04:24.876104')
335
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings"
336
+  (0.4ms) rollback transaction
337
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
338
+  (0.1ms) begin transaction
745
339
  --------------------------------------------------------
746
340
  BulkInsertWorkerTest: test_save!_inserts_pending_records
747
341
  --------------------------------------------------------
748
-  (1.1ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Yo',15,'f','2015-10-08 19:19:49.198581','2015-10-08 19:19:49.198581'),('Hello',25,'t','2015-10-08 19:19:49.198581','2015-10-08 19:19:49.198581')
342
+  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","color","created_at","updated_at") VALUES ('Yo',15,'f','2015-10-28 20:04:55.313829','2015-10-28 20:04:55.313829','2015-10-28 20:04:55.313868'),('Hello',25,'t','2015-10-28 20:04:55.313829','2015-10-28 20:04:55.313829','2015-10-28 20:04:55.313868')
749
343
  Testing Load (0.2ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
750
344
  Testing Load (0.1ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
345
+  (2.1ms) rollback transaction
346
+  (0.1ms) begin transaction
347
+ -------------------------------------------------------------------------------
348
+ BulkInsertWorkerTest: test_add_should_default_timestamp_columns_to_current_time
349
+ -------------------------------------------------------------------------------
350
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","color","created_at","updated_at") VALUES ('Hello',15,'t','chartreuse','2015-10-28 20:04:55.338817','2015-10-28 20:04:55.338817')
351
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
352
+  (0.5ms) rollback transaction
353
+  (0.1ms) begin transaction
354
+ ----------------------------------------------------------------------------------------------
355
+ BulkInsertWorkerTest: test_default_timestamp_columns_should_be_equivalent_for_the_entire_batch
356
+ ----------------------------------------------------------------------------------------------
357
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","color","created_at","updated_at") VALUES ('Hello',15,'t','chartreuse','2015-10-28 20:04:55.341256','2015-10-28 20:04:55.341256'),('Howdy',20,'f','chartreuse','2015-10-28 20:04:55.341256','2015-10-28 20:04:55.341256')
358
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings"
751
359
   (0.5ms) rollback transaction
752
360
   (0.1ms) begin transaction
753
361
  -------------------------------------------
@@ -755,714 +363,814 @@ BulkInsertWorkerTest: test_default_set_size
755
363
  -------------------------------------------
756
364
   (0.0ms) rollback transaction
757
365
   (0.1ms) begin transaction
758
- --------------------------------------------------------------------
759
- BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
760
- --------------------------------------------------------------------
761
-  (0.0ms) rollback transaction
762
-  (0.1ms) begin transaction
763
366
  -------------------------------------------------------------------
764
367
  BulkInsertWorkerTest: test_save!_when_not_pending_should_do_nothing
765
368
  -------------------------------------------------------------------
766
369
   (0.1ms) SELECT COUNT(*) FROM "testings"
767
-  (0.0ms) SELECT COUNT(*) FROM "testings"
370
+  (0.1ms) SELECT COUNT(*) FROM "testings"
768
371
   (0.0ms) rollback transaction
769
372
   (0.1ms) begin transaction
770
- ----------------------------------------------------------------------------------
771
- BulkInsertWorkerTest: test_add_should_save_automatically_when_overflowing_set_size
772
- ----------------------------------------------------------------------------------
773
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-08 19:19:49.218044','2015-10-08 19:19:49.218044')
774
-  (0.0ms) SELECT COUNT(*) FROM "testings"
775
- Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
776
-  (0.4ms) rollback transaction
777
-  (0.1ms) begin transaction
778
373
  ------------------------------------------------------
779
374
  BulkInsertWorkerTest: test_empty_insert_is_not_pending
780
375
  ------------------------------------------------------
781
-  (0.0ms) rollback transaction
782
-  (0.0ms) begin transaction
783
- -------------------------------------------------------------------------------
784
- BulkInsertWorkerTest: test_add_should_default_timestamp_columns_to_current_time
785
- -------------------------------------------------------------------------------
786
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-08 19:19:49.221028','2015-10-08 19:19:49.221029')
787
- Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
788
-  (0.4ms) rollback transaction
789
-  (0.1ms) begin transaction
790
- ---------------------------------------------------------
791
- BulkInsertWorkerTest: test_save!_makes_insert_not_pending
792
- ---------------------------------------------------------
793
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-08 19:19:49.222872','2015-10-08 19:19:49.222872')
794
-  (0.4ms) rollback transaction
376
+  (0.1ms) rollback transaction
795
377
   (0.1ms) begin transaction
796
- ----------------------------------------------------------------
797
- BulkInsertWorkerTest: test_add_should_allow_values_given_as_Hash
798
- ----------------------------------------------------------------
799
-  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Yo',20,'f','2015-10-08 19:19:49.224626','2015-10-08 19:19:49.224626')
800
- Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
801
-  (0.4ms) rollback transaction
802
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
803
-  (0.1ms) begin transaction
804
- -------------------------------------------------------------------
805
- BulkInsertTest: test_bulk_insert_without_block_should_return_worker
806
- -------------------------------------------------------------------
807
-  (0.1ms) rollback transaction
808
-  (0.0ms) begin transaction
809
- -------------------------------------------------------------------
810
- BulkInsertWorkerTest: test_save!_when_not_pending_should_do_nothing
811
- -------------------------------------------------------------------
378
+ ----------------------------------------------------------------------------------
379
+ BulkInsertWorkerTest: test_add_should_save_automatically_when_overflowing_set_size
380
+ ----------------------------------------------------------------------------------
381
+  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","color","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-28 20:04:55.348661','2015-10-28 20:04:55.348661','2015-10-28 20:04:55.348700')
812
382
   (0.1ms) SELECT COUNT(*) FROM "testings"
813
-  (0.0ms) SELECT COUNT(*) FROM "testings"
814
-  (0.0ms) rollback transaction
815
-  (0.0ms) begin transaction
816
- -------------------------------------------
817
- BulkInsertWorkerTest: test_default_set_size
818
- -------------------------------------------
819
-  (0.0ms) rollback transaction
820
-  (0.0ms) begin transaction
383
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
384
+  (0.5ms) rollback transaction
385
+  (0.1ms) begin transaction
821
386
  ----------------------------------------------------------------
822
387
  BulkInsertWorkerTest: test_add_should_allow_values_given_as_Hash
823
388
  ----------------------------------------------------------------
824
-  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Yo',20,'f','2015-10-08 19:27:55.348942','2015-10-08 19:27:55.348942')
389
+  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","color","created_at","updated_at") VALUES ('Yo',20,'f','chartreuse','2015-10-28 20:04:55.352140','2015-10-28 20:04:55.352140')
825
390
  Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
826
391
   (0.5ms) rollback transaction
827
392
   (0.1ms) begin transaction
828
- -------------------------------------------------------------------------------
829
- BulkInsertWorkerTest: test_add_should_default_timestamp_columns_to_current_time
830
- -------------------------------------------------------------------------------
831
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-08 19:27:55.357495','2015-10-08 19:27:55.357496')
393
+ ----------------------------------------------------------------
394
+ BulkInsertWorkerTest: test_explicit_nil_should_override_defaults
395
+ ----------------------------------------------------------------
396
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","color","created_at","updated_at") VALUES ('Hello',20,'f',NULL,'2015-10-28 20:04:55.355649','2015-10-28 20:04:55.355649')
832
397
  Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
833
398
   (0.4ms) rollback transaction
834
399
   (0.1ms) begin transaction
835
- ---------------------------------------------------------
836
- BulkInsertWorkerTest: test_save!_makes_insert_not_pending
837
- ---------------------------------------------------------
838
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-08 19:27:55.359588','2015-10-08 19:27:55.359588')
839
-  (0.4ms) rollback transaction
840
-  (0.1ms) begin transaction
841
- ------------------------------------------------------
842
- BulkInsertWorkerTest: test_empty_insert_is_not_pending
843
- ------------------------------------------------------
844
-  (0.0ms) rollback transaction
845
-  (0.1ms) begin transaction
846
- --------------------------------------------------------
847
- BulkInsertWorkerTest: test_save!_inserts_pending_records
848
- --------------------------------------------------------
849
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Yo',15,'f','2015-10-08 19:27:55.361931','2015-10-08 19:27:55.361931'),('Hello',25,'t','2015-10-08 19:27:55.361931','2015-10-08 19:27:55.361931')
850
- Testing Load (0.1ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
851
- Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
852
-  (0.5ms) rollback transaction
853
-  (0.1ms) begin transaction
854
400
  --------------------------------------------------------------------
855
401
  BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
856
402
  --------------------------------------------------------------------
857
403
   (0.0ms) rollback transaction
858
404
   (0.1ms) begin transaction
859
- ----------------------------------------------------------------------------------
860
- BulkInsertWorkerTest: test_add_should_save_automatically_when_overflowing_set_size
861
- ----------------------------------------------------------------------------------
862
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-08 19:27:55.368129','2015-10-08 19:27:55.368129')
863
-  (0.1ms) SELECT COUNT(*) FROM "testings"
405
+ ---------------------------------------------------------
406
+ BulkInsertWorkerTest: test_save!_makes_insert_not_pending
407
+ ---------------------------------------------------------
408
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","color","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-28 20:04:55.358415','2015-10-28 20:04:55.358415','2015-10-28 20:04:55.358437')
409
+  (0.4ms) rollback transaction
410
+  (0.2ms) begin transaction
411
+ ------------------------------------------------------------------------------
412
+ BulkInsertWorkerTest: test_add_should_use_database_default_values_when_present
413
+ ------------------------------------------------------------------------------
414
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","color","created_at","updated_at") VALUES ('Hello',20,'f','chartreuse','2015-10-28 20:04:55.360282','2015-10-28 20:04:55.360282')
864
415
  Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
865
416
   (0.4ms) rollback transaction
866
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
867
-  (0.1ms) begin transaction
417
+  (0.0ms) begin transaction
868
418
  -------------------------------------------------------------------
869
419
  BulkInsertTest: test_bulk_insert_without_block_should_return_worker
870
420
  -------------------------------------------------------------------
871
-  (0.1ms) rollback transaction
872
-  (0.0ms) begin transaction
873
- --------------------------------------------------------------------
874
- BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
875
- --------------------------------------------------------------------
876
-  (0.0ms) rollback transaction
877
-  (0.0ms) begin transaction
878
- ------------------------------------------------------
879
- BulkInsertWorkerTest: test_empty_insert_is_not_pending
880
- ------------------------------------------------------
881
-  (0.1ms) rollback transaction
882
-  (0.0ms) begin transaction
883
- ---------------------------------------------------------
884
- BulkInsertWorkerTest: test_save!_makes_insert_not_pending
885
- ---------------------------------------------------------
886
-  (1.0ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-08 19:28:19.695411','2015-10-08 19:28:19.695411')
887
-  (1.9ms) rollback transaction
421
+  (0.0ms) rollback transaction
888
422
   (0.1ms) begin transaction
889
- -------------------------------------------------------------------
890
- BulkInsertWorkerTest: test_save!_when_not_pending_should_do_nothing
891
- -------------------------------------------------------------------
423
+ ---------------------------------------------------------------------
424
+ BulkInsertTest: test_bulk_insert_with_block_should_save_automatically
425
+ ---------------------------------------------------------------------
426
+  (0.1ms) SELECT COUNT(*) FROM "testings"
427
+  (0.0ms) SAVEPOINT active_record_1
428
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',NULL,NULL,'2015-10-28 20:04:55.365420','2015-10-28 20:04:55.365420','chartreuse')
429
+  (0.0ms) RELEASE SAVEPOINT active_record_1
892
430
   (0.1ms) SELECT COUNT(*) FROM "testings"
893
-  (0.1ms) SELECT COUNT(*) FROM "testings"
894
-  (0.0ms) rollback transaction
895
-  (0.0ms) begin transaction
896
- --------------------------------------------------------
897
- BulkInsertWorkerTest: test_save!_inserts_pending_records
898
- --------------------------------------------------------
899
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Yo',15,'f','2015-10-08 19:28:19.702958','2015-10-08 19:28:19.702958'),('Hello',25,'t','2015-10-08 19:28:19.702958','2015-10-08 19:28:19.702958')
900
- Testing Load (0.1ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
901
- Testing Load (0.1ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
902
-  (0.7ms) rollback transaction
903
-  (0.1ms) begin transaction
904
- ----------------------------------------------------------------
905
- BulkInsertWorkerTest: test_add_should_allow_values_given_as_Hash
906
- ----------------------------------------------------------------
907
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Yo',20,'f','2015-10-08 19:28:19.713902','2015-10-08 19:28:19.713902')
908
- Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
909
431
   (0.4ms) rollback transaction
910
432
   (0.1ms) begin transaction
911
- -------------------------------------------
912
- BulkInsertWorkerTest: test_default_set_size
913
- -------------------------------------------
433
+ ------------------------------------------------------------------------------
434
+ BulkInsertTest: test_default_bulk_columns_should_return_all_columns_without_id
435
+ ------------------------------------------------------------------------------
914
436
   (0.0ms) rollback transaction
915
437
   (0.1ms) begin transaction
916
- ----------------------------------------------------------------------------------
917
- BulkInsertWorkerTest: test_add_should_save_automatically_when_overflowing_set_size
918
- ----------------------------------------------------------------------------------
919
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-08 19:28:19.716840','2015-10-08 19:28:19.716840')
920
-  (0.0ms) SELECT COUNT(*) FROM "testings"
921
- Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
922
-  (0.4ms) rollback transaction
438
+ -----------------------------------------------------------------------------
439
+ BulkInsertTest: test_bulk_insert_with_array_should_save_the_array_immediately
440
+ -----------------------------------------------------------------------------
441
+  (0.2ms) SELECT COUNT(*) FROM "testings"
442
+  (0.1ms) rollback transaction
923
443
   (0.1ms) begin transaction
924
- -------------------------------------------------------------------------------
925
- BulkInsertWorkerTest: test_add_should_default_timestamp_columns_to_current_time
926
- -------------------------------------------------------------------------------
927
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-08 19:28:19.718998','2015-10-08 19:28:19.719000')
928
- Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
929
-  (0.5ms) rollback transaction
444
+ ---------------------------------------------------------------
445
+ BulkInsertTest: test_bulk_insert_with_block_should_yield_worker
446
+ ---------------------------------------------------------------
447
+  (0.1ms) SAVEPOINT active_record_1
448
+  (0.1ms) RELEASE SAVEPOINT active_record_1
449
+  (0.1ms) rollback transaction
930
450
  ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
931
451
   (0.1ms) begin transaction
932
452
  ---------------------------------------------------------------
933
453
  BulkInsertTest: test_bulk_insert_with_block_should_yield_worker
934
454
  ---------------------------------------------------------------
935
-  (0.0ms) SAVEPOINT active_record_1
455
+  (0.1ms) SAVEPOINT active_record_1
936
456
   (0.0ms) RELEASE SAVEPOINT active_record_1
937
-  (0.0ms) rollback transaction
457
+  (0.1ms) rollback transaction
458
+  (0.1ms) begin transaction
459
+ -----------------------------------------------------------------------------
460
+ BulkInsertTest: test_bulk_insert_with_array_should_save_the_array_immediately
461
+ -----------------------------------------------------------------------------
462
+  (0.1ms) SELECT COUNT(*) FROM "testings"
463
+  (0.1ms) SELECT COUNT(*) FROM "testings"
464
+  (0.1ms) rollback transaction
938
465
   (0.1ms) begin transaction
939
466
  -------------------------------------------------------------------
940
467
  BulkInsertTest: test_bulk_insert_without_block_should_return_worker
941
468
  -------------------------------------------------------------------
942
-  (0.0ms) rollback transaction
943
-  (0.0ms) begin transaction
944
- -------------------------------------------
945
- BulkInsertWorkerTest: test_default_set_size
946
- -------------------------------------------
947
-  (0.0ms) rollback transaction
469
+  (0.1ms) rollback transaction
948
470
   (0.1ms) begin transaction
949
- --------------------------------------------------------
950
- BulkInsertWorkerTest: test_save!_inserts_pending_records
951
- --------------------------------------------------------
952
-  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Yo',15,'f','2015-10-08 19:29:51.980737','2015-10-08 19:29:51.980737'),('Hello',25,'t','2015-10-08 19:29:51.980737','2015-10-08 19:29:51.980737')
953
- Testing Load (0.1ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
954
- Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
955
-  (2.3ms) rollback transaction
471
+ ---------------------------------------------------------------------
472
+ BulkInsertTest: test_bulk_insert_with_block_should_save_automatically
473
+ ---------------------------------------------------------------------
474
+  (0.1ms) SELECT COUNT(*) FROM "testings"
475
+  (0.0ms) SAVEPOINT active_record_1
476
+  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',NULL,NULL,'2015-10-28 20:05:11.145797','2015-10-28 20:05:11.145797','chartreuse')
477
+  (0.0ms) RELEASE SAVEPOINT active_record_1
478
+  (0.1ms) SELECT COUNT(*) FROM "testings"
479
+  (1.5ms) rollback transaction
956
480
   (0.2ms) begin transaction
957
- ------------------------------------------------------
958
- BulkInsertWorkerTest: test_empty_insert_is_not_pending
959
- ------------------------------------------------------
481
+ ------------------------------------------------------------------------------
482
+ BulkInsertTest: test_default_bulk_columns_should_return_all_columns_without_id
483
+ ------------------------------------------------------------------------------
960
484
   (0.1ms) rollback transaction
485
+  (0.0ms) begin transaction
486
+ ----------------------------------------------------------------------------------------------
487
+ BulkInsertWorkerTest: test_default_timestamp_columns_should_be_equivalent_for_the_entire_batch
488
+ ----------------------------------------------------------------------------------------------
489
+  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","color","created_at","updated_at") VALUES ('Hello',15,'t','chartreuse','2015-10-28 20:05:11.153186','2015-10-28 20:05:11.153186'),('Howdy',20,'f','chartreuse','2015-10-28 20:05:11.153186','2015-10-28 20:05:11.153186')
490
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings"
491
+  (0.5ms) rollback transaction
961
492
   (0.1ms) begin transaction
962
493
  ----------------------------------------------------------------
963
494
  BulkInsertWorkerTest: test_add_should_allow_values_given_as_Hash
964
495
  ----------------------------------------------------------------
965
-  (0.4ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Yo',20,'f','2015-10-08 19:29:51.996477','2015-10-08 19:29:51.996477')
496
+  (1.7ms) INSERT INTO "testings" ("greeting","age","happy","color","created_at","updated_at") VALUES ('Yo',20,'f','chartreuse','2015-10-28 20:05:11.171453','2015-10-28 20:05:11.171453')
966
497
  Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
967
-  (0.6ms) rollback transaction
498
+  (0.5ms) rollback transaction
968
499
   (0.1ms) begin transaction
969
500
  --------------------------------------------------------------------
970
501
  BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
971
502
  --------------------------------------------------------------------
972
503
   (0.0ms) rollback transaction
973
-  (0.0ms) begin transaction
974
- -------------------------------------------------------------------------------
975
- BulkInsertWorkerTest: test_add_should_default_timestamp_columns_to_current_time
976
- -------------------------------------------------------------------------------
977
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-08 19:29:52.000596','2015-10-08 19:29:52.000598')
978
- Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
979
-  (0.4ms) rollback transaction
980
504
   (0.1ms) begin transaction
981
- ----------------------------------------------------------------------------------
982
- BulkInsertWorkerTest: test_add_should_save_automatically_when_overflowing_set_size
983
- ----------------------------------------------------------------------------------
984
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-08 19:29:52.002596','2015-10-08 19:29:52.002596')
985
-  (0.1ms) SELECT COUNT(*) FROM "testings"
505
+ --------------------------------------------------------
506
+ BulkInsertWorkerTest: test_save!_inserts_pending_records
507
+ --------------------------------------------------------
508
+  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","color","created_at","updated_at") VALUES ('Yo',15,'f','2015-10-28 20:05:11.178283','2015-10-28 20:05:11.178283','2015-10-28 20:05:11.178323'),('Hello',25,'t','2015-10-28 20:05:11.178283','2015-10-28 20:05:11.178283','2015-10-28 20:05:11.178323')
509
+ Testing Load (0.2ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
510
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
511
+  (0.4ms) rollback transaction
512
+  (0.1ms) begin transaction
513
+ ------------------------------------------------------------------------------
514
+ BulkInsertWorkerTest: test_add_should_use_database_default_values_when_present
515
+ ------------------------------------------------------------------------------
516
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","color","created_at","updated_at") VALUES ('Hello',20,'f','chartreuse','2015-10-28 20:05:11.186006','2015-10-28 20:05:11.186006')
986
517
  Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
987
-  (0.5ms) rollback transaction
518
+  (0.4ms) rollback transaction
988
519
   (0.1ms) begin transaction
989
520
  ---------------------------------------------------------
990
521
  BulkInsertWorkerTest: test_save!_makes_insert_not_pending
991
522
  ---------------------------------------------------------
992
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-08 19:29:52.005251','2015-10-08 19:29:52.005251')
523
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","color","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-28 20:05:11.187879','2015-10-28 20:05:11.187879','2015-10-28 20:05:11.187899')
524
+  (0.4ms) rollback transaction
525
+  (0.1ms) begin transaction
526
+ -------------------------------------------------------------------------------
527
+ BulkInsertWorkerTest: test_add_should_default_timestamp_columns_to_current_time
528
+ -------------------------------------------------------------------------------
529
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","color","created_at","updated_at") VALUES ('Hello',15,'t','chartreuse','2015-10-28 20:05:11.189483','2015-10-28 20:05:11.189483')
530
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
993
531
   (0.4ms) rollback transaction
994
532
   (0.1ms) begin transaction
995
533
  -------------------------------------------------------------------
996
534
  BulkInsertWorkerTest: test_save!_when_not_pending_should_do_nothing
997
535
  -------------------------------------------------------------------
998
-  (0.1ms) SELECT COUNT(*) FROM "testings"
999
-  (0.0ms) SELECT COUNT(*) FROM "testings"
1000
-  (0.0ms) rollback transaction
1001
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1002
-  (0.1ms) begin transaction
1003
- --------------------------------------------------------
1004
- BulkInsertWorkerTest: test_save!_inserts_pending_records
1005
- --------------------------------------------------------
1006
-  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Yo',15,'f','2015-10-08 19:30:46.363080','2015-10-08 19:30:46.363080'),('Hello',25,'t','2015-10-08 19:30:46.363080','2015-10-08 19:30:46.363080')
1007
- Testing Load (0.1ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
1008
- Testing Load (0.1ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
1009
-  (2.6ms) rollback transaction
536
+  (0.2ms) SELECT COUNT(*) FROM "testings"
537
+  (0.1ms) SELECT COUNT(*) FROM "testings"
538
+  (0.1ms) rollback transaction
539
+  (0.0ms) begin transaction
540
+ -------------------------------------------
541
+ BulkInsertWorkerTest: test_default_set_size
542
+ -------------------------------------------
543
+  (0.1ms) rollback transaction
544
+  (0.1ms) begin transaction
545
+ ----------------------------------------------------------------
546
+ BulkInsertWorkerTest: test_explicit_nil_should_override_defaults
547
+ ----------------------------------------------------------------
548
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","color","created_at","updated_at") VALUES ('Hello',20,'f',NULL,'2015-10-28 20:05:11.195762','2015-10-28 20:05:11.195762')
549
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
550
+  (0.5ms) rollback transaction
1010
551
   (0.1ms) begin transaction
1011
552
  ----------------------------------------------------------------------------------
1012
553
  BulkInsertWorkerTest: test_add_should_save_automatically_when_overflowing_set_size
1013
554
  ----------------------------------------------------------------------------------
1014
-  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-08 19:30:46.379389','2015-10-08 19:30:46.379389')
1015
-  (0.1ms) SELECT COUNT(*) FROM "testings"
555
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","color","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-28 20:05:11.197966','2015-10-28 20:05:11.197966','2015-10-28 20:05:11.197996')
556
+  (0.0ms) SELECT COUNT(*) FROM "testings"
1016
557
  Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
1017
-  (0.5ms) rollback transaction
558
+  (0.4ms) rollback transaction
559
+  (0.0ms) begin transaction
560
+ ------------------------------------------------------
561
+ BulkInsertWorkerTest: test_empty_insert_is_not_pending
562
+ ------------------------------------------------------
563
+  (0.0ms) rollback transaction
564
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
565
+  (0.1ms) begin transaction
566
+ -------------------------------------------------------------------
567
+ BulkInsertTest: test_bulk_insert_without_block_should_return_worker
568
+ -------------------------------------------------------------------
569
+  (0.0ms) rollback transaction
1018
570
   (0.1ms) begin transaction
571
+ ---------------------------------------------------------------------
572
+ BulkInsertTest: test_bulk_insert_with_block_should_save_automatically
573
+ ---------------------------------------------------------------------
574
+  (0.1ms) SELECT COUNT(*) FROM "testings"
575
+  (0.0ms) SAVEPOINT active_record_1
576
+  (0.4ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',NULL,NULL,'2015-10-28 20:08:36.160464','2015-10-28 20:08:36.160464','chartreuse')
577
+  (0.0ms) RELEASE SAVEPOINT active_record_1
578
+  (0.1ms) SELECT COUNT(*) FROM "testings"
579
+  (1.4ms) rollback transaction
580
+  (0.1ms) begin transaction
581
+ -----------------------------------------------------------------------------
582
+ BulkInsertTest: test_bulk_insert_with_array_should_save_the_array_immediately
583
+ -----------------------------------------------------------------------------
584
+  (0.2ms) SELECT COUNT(*) FROM "testings"
585
+  (0.1ms) SELECT COUNT(*) FROM "testings"
586
+  (0.0ms) rollback transaction
587
+  (0.1ms) begin transaction
588
+ ---------------------------------------------------------------
589
+ BulkInsertTest: test_bulk_insert_with_block_should_yield_worker
590
+ ---------------------------------------------------------------
591
+  (0.0ms) SAVEPOINT active_record_1
592
+  (0.0ms) RELEASE SAVEPOINT active_record_1
593
+  (0.0ms) rollback transaction
594
+  (0.1ms) begin transaction
595
+ ------------------------------------------------------------------------------
596
+ BulkInsertTest: test_default_bulk_columns_should_return_all_columns_without_id
597
+ ------------------------------------------------------------------------------
598
+  (0.0ms) rollback transaction
599
+  (0.0ms) begin transaction
600
+ -------------------------------------------------------------------------------
601
+ BulkInsertWorkerTest: test_add_should_default_timestamp_columns_to_current_time
602
+ -------------------------------------------------------------------------------
603
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2015-10-28 20:08:36.168789','2015-10-28 20:08:36.168789','chartreuse')
604
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
605
+  (0.5ms) rollback transaction
606
+  (0.1ms) begin transaction
1019
607
  ----------------------------------------------------------------
1020
- BulkInsertWorkerTest: test_add_should_allow_values_given_as_Hash
608
+ BulkInsertWorkerTest: test_explicit_nil_should_override_defaults
1021
609
  ----------------------------------------------------------------
1022
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Yo',20,'f','2015-10-08 19:30:46.382292','2015-10-08 19:30:46.382292')
1023
- Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
610
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',20,'f','2015-10-28 20:08:36.185961','2015-10-28 20:08:36.185961',NULL)
611
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
612
+  (0.4ms) rollback transaction
613
+  (0.1ms) begin transaction
614
+ --------------------------------------------------------
615
+ BulkInsertWorkerTest: test_save!_inserts_pending_records
616
+ --------------------------------------------------------
617
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',15,'f','2015-10-28 20:08:36.187970','2015-10-28 20:08:36.187970','chartreuse'),('Hello',25,'t','2015-10-28 20:08:36.187970','2015-10-28 20:08:36.187970','chartreuse')
618
+ Testing Load (0.2ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
619
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
1024
620
   (0.4ms) rollback transaction
1025
-  (0.2ms) begin transaction
621
+  (0.0ms) begin transaction
1026
622
  --------------------------------------------------------------------
1027
623
  BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
1028
624
  --------------------------------------------------------------------
1029
625
   (0.0ms) rollback transaction
1030
-  (0.1ms) begin transaction
1031
- -------------------------------------------------------------------------------
1032
- BulkInsertWorkerTest: test_add_should_default_timestamp_columns_to_current_time
1033
- -------------------------------------------------------------------------------
1034
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-08 19:30:46.384879','2015-10-08 19:30:46.384880')
626
+  (0.0ms) begin transaction
627
+ ----------------------------------------------------------------------------------------------
628
+ BulkInsertWorkerTest: test_default_timestamp_columns_should_be_equivalent_for_the_entire_batch
629
+ ----------------------------------------------------------------------------------------------
630
+  (0.4ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2015-10-28 20:08:36.196327','2015-10-28 20:08:36.196327','chartreuse'),('Howdy',20,'f','2015-10-28 20:08:36.196327','2015-10-28 20:08:36.196327','chartreuse')
631
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings"
632
+  (0.4ms) rollback transaction
633
+  (0.0ms) begin transaction
634
+ ------------------------------------------------------------------------------
635
+ BulkInsertWorkerTest: test_add_should_use_database_default_values_when_present
636
+ ------------------------------------------------------------------------------
637
+  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',20,'f','2015-10-28 20:08:36.199777','2015-10-28 20:08:36.199777','chartreuse')
1035
638
  Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
1036
639
   (0.4ms) rollback transaction
1037
640
   (0.1ms) begin transaction
1038
- -------------------------------------------
1039
- BulkInsertWorkerTest: test_default_set_size
1040
- -------------------------------------------
1041
-  (0.1ms) rollback transaction
1042
-  (0.1ms) begin transaction
641
+ ----------------------------------------------------------------------------------
642
+ BulkInsertWorkerTest: test_add_should_save_automatically_when_overflowing_set_size
643
+ ----------------------------------------------------------------------------------
644
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2015-10-28 20:08:36.201884','2015-10-28 20:08:36.201884','chartreuse')
645
+  (0.0ms) SELECT COUNT(*) FROM "testings"
646
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
647
+  (0.4ms) rollback transaction
648
+  (0.1ms) begin transaction
649
+ ---------------------------------------------------------
650
+ BulkInsertWorkerTest: test_save!_makes_insert_not_pending
651
+ ---------------------------------------------------------
652
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2015-10-28 20:08:36.204178','2015-10-28 20:08:36.204178','chartreuse')
653
+  (0.4ms) rollback transaction
654
+  (0.0ms) begin transaction
1043
655
  ------------------------------------------------------
1044
656
  BulkInsertWorkerTest: test_empty_insert_is_not_pending
1045
657
  ------------------------------------------------------
1046
658
   (0.0ms) rollback transaction
1047
-  (0.1ms) begin transaction
1048
- ---------------------------------------------------------
1049
- BulkInsertWorkerTest: test_save!_makes_insert_not_pending
1050
- ---------------------------------------------------------
1051
-  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-08 19:30:46.388867','2015-10-08 19:30:46.388867')
1052
-  (0.5ms) rollback transaction
1053
-  (0.1ms) begin transaction
659
+  (0.0ms) begin transaction
1054
660
  -------------------------------------------------------------------
1055
661
  BulkInsertWorkerTest: test_save!_when_not_pending_should_do_nothing
1056
662
  -------------------------------------------------------------------
1057
-  (0.1ms) SELECT COUNT(*) FROM "testings"
1058
-  (0.0ms) SELECT COUNT(*) FROM "testings"
1059
-  (0.0ms) rollback transaction
1060
-  (0.0ms) begin transaction
663
+  (0.1ms) SELECT COUNT(*) FROM "testings"
664
+  (0.0ms) SELECT COUNT(*) FROM "testings"
665
+  (0.0ms) rollback transaction
666
+  (0.1ms) begin transaction
667
+ ----------------------------------------------------------------
668
+ BulkInsertWorkerTest: test_add_should_allow_values_given_as_Hash
669
+ ----------------------------------------------------------------
670
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',20,'f','2015-10-28 20:08:36.207778','2015-10-28 20:08:36.207778','chartreuse')
671
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
672
+  (0.4ms) rollback transaction
673
+  (0.1ms) begin transaction
674
+ -------------------------------------------
675
+ BulkInsertWorkerTest: test_default_set_size
676
+ -------------------------------------------
677
+  (0.0ms) rollback transaction
678
+  (0.1ms) begin transaction
1061
679
  ---------------------------------------------------------------------
1062
- BulkInsertTest: test_bulk_insert_with_block_should_save_automatically
680
+ BulkInsertWorkerTest: test_add_all_should_append_all_items_to_the_set
1063
681
  ---------------------------------------------------------------------
1064
-  (0.1ms) SELECT COUNT(*) FROM "testings"
1065
-  (0.0ms) SAVEPOINT active_record_1
1066
-  (0.5ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',NULL,NULL,'2015-10-08 19:30:46.394298','2015-10-08 19:30:46.394301')
1067
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1068
-  (0.1ms) SELECT COUNT(*) FROM "testings"
1069
-  (0.6ms) rollback transaction
1070
-  (0.0ms) begin transaction
1071
- ---------------------------------------------------------------
1072
- BulkInsertTest: test_bulk_insert_with_block_should_yield_worker
1073
- ---------------------------------------------------------------
1074
-  (0.0ms) SAVEPOINT active_record_1
1075
-  (0.0ms) RELEASE SAVEPOINT active_record_1
1076
682
   (0.0ms) rollback transaction
1077
683
   (0.0ms) begin transaction
684
+ ----------------------------------------------------------------------------
685
+ BulkInsertWorkerTest: test_pending_count_should_describe_size_of_pending_set
686
+ ----------------------------------------------------------------------------
687
+  (0.0ms) rollback transaction
688
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
689
+  (0.1ms) begin transaction
690
+ ------------------------------------------------------------------------------
691
+ BulkInsertTest: test_default_bulk_columns_should_return_all_columns_without_id
692
+ ------------------------------------------------------------------------------
693
+  (0.0ms) rollback transaction
694
+  (0.1ms) begin transaction
1078
695
  -------------------------------------------------------------------
1079
696
  BulkInsertTest: test_bulk_insert_without_block_should_return_worker
1080
697
  -------------------------------------------------------------------
1081
-  (0.0ms) rollback transaction
1082
- ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
698
+  (0.1ms) rollback transaction
1083
699
   (0.1ms) begin transaction
1084
700
  ---------------------------------------------------------------
1085
701
  BulkInsertTest: test_bulk_insert_with_block_should_yield_worker
1086
702
  ---------------------------------------------------------------
1087
-  (0.0ms) SAVEPOINT active_record_1
1088
-  (0.0ms) RELEASE SAVEPOINT active_record_1
1089
-  (0.0ms) rollback transaction
1090
-  (0.0ms) begin transaction
703
+  (0.1ms) SAVEPOINT active_record_1
704
+  (0.1ms) RELEASE SAVEPOINT active_record_1
705
+  (0.1ms) rollback transaction
706
+  (0.1ms) begin transaction
1091
707
  ---------------------------------------------------------------------
1092
708
  BulkInsertTest: test_bulk_insert_with_block_should_save_automatically
1093
709
  ---------------------------------------------------------------------
1094
-  (0.5ms) SELECT COUNT(*) FROM "testings"
710
+  (0.2ms) SELECT COUNT(*) FROM "testings"
1095
711
   (0.0ms) SAVEPOINT active_record_1
1096
-  (0.7ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',NULL,NULL,'2015-10-09 03:35:12.083541','2015-10-09 03:35:12.083543')
712
+  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',NULL,NULL,'2015-10-28 20:09:27.946829','2015-10-28 20:09:27.946829','chartreuse')
1097
713
   (0.0ms) RELEASE SAVEPOINT active_record_1
1098
714
   (0.1ms) SELECT COUNT(*) FROM "testings"
1099
-  (0.4ms) rollback transaction
1100
-  (0.1ms) begin transaction
1101
- -------------------------------------------------------------------
1102
- BulkInsertTest: test_bulk_insert_without_block_should_return_worker
1103
- -------------------------------------------------------------------
715
+  (1.8ms) rollback transaction
716
+  (0.4ms) begin transaction
717
+ -----------------------------------------------------------------------------
718
+ BulkInsertTest: test_bulk_insert_with_array_should_save_the_array_immediately
719
+ -----------------------------------------------------------------------------
720
+  (0.1ms) SELECT COUNT(*) FROM "testings"
721
+  (0.0ms) SELECT COUNT(*) FROM "testings"
1104
722
   (0.0ms) rollback transaction
1105
723
   (0.0ms) begin transaction
724
+ ----------------------------------------------------------------------------------------------
725
+ BulkInsertWorkerTest: test_default_timestamp_columns_should_be_equivalent_for_the_entire_batch
726
+ ----------------------------------------------------------------------------------------------
727
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2015-10-28 20:09:27.954680','2015-10-28 20:09:27.954680','chartreuse'),('Howdy',20,'f','2015-10-28 20:09:27.954680','2015-10-28 20:09:27.954680','chartreuse')
728
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings"
729
+  (0.5ms) rollback transaction
730
+  (0.1ms) begin transaction
1106
731
  ------------------------------------------------------
1107
732
  BulkInsertWorkerTest: test_empty_insert_is_not_pending
1108
733
  ------------------------------------------------------
1109
-  (0.0ms) rollback transaction
1110
-  (0.0ms) begin transaction
1111
- -------------------------------------------
1112
- BulkInsertWorkerTest: test_default_set_size
1113
- -------------------------------------------
1114
734
   (0.0ms) rollback transaction
1115
735
   (0.1ms) begin transaction
1116
- ----------------------------------------------------------------
1117
- BulkInsertWorkerTest: test_add_should_allow_values_given_as_Hash
1118
- ----------------------------------------------------------------
1119
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Yo',20,'f','2015-10-09 03:35:12.090722','2015-10-09 03:35:12.090722')
736
+ ------------------------------------------------------------------------------
737
+ BulkInsertWorkerTest: test_add_should_use_database_default_values_when_present
738
+ ------------------------------------------------------------------------------
739
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',20,'f','2015-10-28 20:09:27.963276','2015-10-28 20:09:27.963276','chartreuse')
1120
740
  Testing Load (0.2ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
1121
741
   (0.5ms) rollback transaction
742
+  (0.0ms) begin transaction
743
+ ---------------------------------------------------------------------
744
+ BulkInsertWorkerTest: test_add_all_should_append_all_items_to_the_set
745
+ ---------------------------------------------------------------------
746
+  (0.0ms) rollback transaction
1122
747
   (0.1ms) begin transaction
1123
748
  --------------------------------------------------------------------
1124
749
  BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
1125
750
  --------------------------------------------------------------------
1126
751
   (0.0ms) rollback transaction
1127
752
   (0.1ms) begin transaction
753
+ -------------------------------------------------------------------
754
+ BulkInsertWorkerTest: test_save!_when_not_pending_should_do_nothing
755
+ -------------------------------------------------------------------
756
+  (0.0ms) SELECT COUNT(*) FROM "testings"
757
+  (0.0ms) SELECT COUNT(*) FROM "testings"
758
+  (0.0ms) rollback transaction
759
+  (0.1ms) begin transaction
1128
760
  ----------------------------------------------------------------------------------
1129
761
  BulkInsertWorkerTest: test_add_should_save_automatically_when_overflowing_set_size
1130
762
  ----------------------------------------------------------------------------------
1131
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-09 03:35:12.098305','2015-10-09 03:35:12.098305')
763
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2015-10-28 20:09:27.969154','2015-10-28 20:09:27.969154','chartreuse')
1132
764
   (0.1ms) SELECT COUNT(*) FROM "testings"
1133
765
  Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
1134
-  (0.5ms) rollback transaction
766
+  (0.4ms) rollback transaction
767
+  (0.1ms) begin transaction
768
+ -------------------------------------------
769
+ BulkInsertWorkerTest: test_default_set_size
770
+ -------------------------------------------
771
+  (0.1ms) rollback transaction
772
+  (0.0ms) begin transaction
773
+ ----------------------------------------------------------------
774
+ BulkInsertWorkerTest: test_explicit_nil_should_override_defaults
775
+ ----------------------------------------------------------------
776
+  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',20,'f','2015-10-28 20:09:27.974010','2015-10-28 20:09:27.974010',NULL)
777
+ Testing Load (0.2ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
778
+  (0.4ms) rollback transaction
779
+  (0.1ms) begin transaction
780
+ ----------------------------------------------------------------
781
+ BulkInsertWorkerTest: test_add_should_allow_values_given_as_Hash
782
+ ----------------------------------------------------------------
783
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',20,'f','2015-10-28 20:09:27.976276','2015-10-28 20:09:27.976276','chartreuse')
784
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
785
+  (0.4ms) rollback transaction
1135
786
   (0.1ms) begin transaction
1136
787
  -------------------------------------------------------------------------------
1137
788
  BulkInsertWorkerTest: test_add_should_default_timestamp_columns_to_current_time
1138
789
  -------------------------------------------------------------------------------
1139
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-09 03:35:12.100627','2015-10-09 03:35:12.100628')
790
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2015-10-28 20:09:27.979366','2015-10-28 20:09:27.979366','chartreuse')
1140
791
  Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
1141
792
   (0.4ms) rollback transaction
1142
793
   (0.1ms) begin transaction
1143
- --------------------------------------------------------
1144
- BulkInsertWorkerTest: test_save!_inserts_pending_records
1145
- --------------------------------------------------------
1146
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Yo',15,'f','2015-10-09 03:35:12.102561','2015-10-09 03:35:12.102561'),('Hello',25,'t','2015-10-09 03:35:12.102561','2015-10-09 03:35:12.102561')
1147
- Testing Load (0.2ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
1148
- Testing Load (0.1ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
1149
-  (0.5ms) rollback transaction
1150
-  (0.1ms) begin transaction
794
+ ----------------------------------------------------------------------------
795
+ BulkInsertWorkerTest: test_pending_count_should_describe_size_of_pending_set
796
+ ----------------------------------------------------------------------------
797
+  (0.0ms) rollback transaction
798
+  (0.1ms) begin transaction
1151
799
  ---------------------------------------------------------
1152
800
  BulkInsertWorkerTest: test_save!_makes_insert_not_pending
1153
801
  ---------------------------------------------------------
1154
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-09 03:35:12.112592','2015-10-09 03:35:12.112592')
1155
-  (9.0ms) rollback transaction
1156
-  (0.0ms) begin transaction
802
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2015-10-28 20:09:27.982136','2015-10-28 20:09:27.982136','chartreuse')
803
+  (0.4ms) rollback transaction
804
+  (0.1ms) begin transaction
805
+ --------------------------------------------------------
806
+ BulkInsertWorkerTest: test_save!_inserts_pending_records
807
+ --------------------------------------------------------
808
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',15,'f','2015-10-28 20:09:27.983507','2015-10-28 20:09:27.983507','chartreuse'),('Hello',25,'t','2015-10-28 20:09:27.983507','2015-10-28 20:09:27.983507','chartreuse')
809
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
810
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
811
+  (0.5ms) rollback transaction
812
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
813
+  (0.1ms) begin transaction
814
+ ------------------------------------------------------------------------------
815
+ BulkInsertTest: test_default_bulk_columns_should_return_all_columns_without_id
816
+ ------------------------------------------------------------------------------
817
+  (0.0ms) rollback transaction
818
+  (0.1ms) begin transaction
1157
819
  -------------------------------------------------------------------
1158
- BulkInsertWorkerTest: test_save!_when_not_pending_should_do_nothing
820
+ BulkInsertTest: test_bulk_insert_without_block_should_return_worker
1159
821
  -------------------------------------------------------------------
822
+  (0.0ms) rollback transaction
823
+  (0.1ms) begin transaction
824
+ -----------------------------------------------------------------------------
825
+ BulkInsertTest: test_bulk_insert_with_array_should_save_the_array_immediately
826
+ -----------------------------------------------------------------------------
1160
827
   (0.1ms) SELECT COUNT(*) FROM "testings"
1161
828
   (0.0ms) SELECT COUNT(*) FROM "testings"
1162
829
   (0.0ms) rollback transaction
1163
- ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
830
+  (0.1ms) begin transaction
831
+ ---------------------------------------------------------------
832
+ BulkInsertTest: test_bulk_insert_with_block_should_yield_worker
833
+ ---------------------------------------------------------------
834
+  (0.1ms) SAVEPOINT active_record_1
835
+  (0.1ms) RELEASE SAVEPOINT active_record_1
836
+  (0.1ms) rollback transaction
1164
837
   (0.1ms) begin transaction
1165
838
  ---------------------------------------------------------------------
1166
839
  BulkInsertTest: test_bulk_insert_with_block_should_save_automatically
1167
840
  ---------------------------------------------------------------------
1168
-  (0.5ms) SELECT COUNT(*) FROM "testings"
841
+  (0.1ms) SELECT COUNT(*) FROM "testings"
1169
842
   (0.0ms) SAVEPOINT active_record_1
1170
-  (0.7ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',NULL,NULL,'2015-10-09 14:46:00.198423','2015-10-09 14:46:00.198425')
1171
-  (0.1ms) RELEASE SAVEPOINT active_record_1
843
+  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',NULL,NULL,'2015-10-28 20:09:47.625618','2015-10-28 20:09:47.625618','chartreuse')
844
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1172
845
   (0.1ms) SELECT COUNT(*) FROM "testings"
1173
-  (0.5ms) rollback transaction
1174
-  (0.1ms) begin transaction
1175
- -------------------------------------------------------------------
1176
- BulkInsertTest: test_bulk_insert_without_block_should_return_worker
1177
- -------------------------------------------------------------------
1178
-  (0.1ms) rollback transaction
846
+  (1.9ms) rollback transaction
1179
847
   (0.1ms) begin transaction
1180
- ---------------------------------------------------------------
1181
- BulkInsertTest: test_bulk_insert_with_block_should_yield_worker
1182
- ---------------------------------------------------------------
1183
-  (0.0ms) SAVEPOINT active_record_1
1184
-  (0.0ms) RELEASE SAVEPOINT active_record_1
1185
-  (0.0ms) rollback transaction
1186
-  (0.0ms) begin transaction
1187
848
  -------------------------------------------
1188
849
  BulkInsertWorkerTest: test_default_set_size
1189
850
  -------------------------------------------
1190
851
   (0.0ms) rollback transaction
1191
852
   (0.1ms) begin transaction
1192
- ------------------------------------------------------
1193
- BulkInsertWorkerTest: test_empty_insert_is_not_pending
1194
- ------------------------------------------------------
853
+ ---------------------------------------------------------------------
854
+ BulkInsertWorkerTest: test_add_all_should_append_all_items_to_the_set
855
+ ---------------------------------------------------------------------
1195
856
   (0.0ms) rollback transaction
1196
857
   (0.1ms) begin transaction
1197
- --------------------------------------------------------
1198
- BulkInsertWorkerTest: test_save!_inserts_pending_records
1199
- --------------------------------------------------------
1200
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Yo',15,'f','2015-10-09 14:46:00.208247','2015-10-09 14:46:00.208247'),('Hello',25,'t','2015-10-09 14:46:00.208247','2015-10-09 14:46:00.208247')
1201
- Testing Load (0.2ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
1202
- Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
1203
-  (0.5ms) rollback transaction
1204
-  (0.1ms) begin transaction
1205
858
  -------------------------------------------------------------------------------
1206
859
  BulkInsertWorkerTest: test_add_should_default_timestamp_columns_to_current_time
1207
860
  -------------------------------------------------------------------------------
1208
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-09 14:46:00.221284','2015-10-09 14:46:00.221285')
1209
- Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
1210
-  (0.4ms) rollback transaction
1211
-  (0.1ms) begin transaction
1212
- ---------------------------------------------------------
1213
- BulkInsertWorkerTest: test_save!_makes_insert_not_pending
1214
- ---------------------------------------------------------
1215
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-09 14:46:00.223669','2015-10-09 14:46:00.223669')
1216
-  (0.4ms) rollback transaction
861
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2015-10-28 20:09:47.633058','2015-10-28 20:09:47.633058','chartreuse')
862
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
863
+  (0.5ms) rollback transaction
864
+  (0.1ms) begin transaction
865
+ ----------------------------------------------------------------
866
+ BulkInsertWorkerTest: test_explicit_nil_should_override_defaults
867
+ ----------------------------------------------------------------
868
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',20,'f','2015-10-28 20:09:47.649491','2015-10-28 20:09:47.649491',NULL)
869
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
870
+  (0.5ms) rollback transaction
871
+  (0.1ms) begin transaction
872
+ ----------------------------------------------------------------
873
+ BulkInsertWorkerTest: test_add_should_allow_values_given_as_Hash
874
+ ----------------------------------------------------------------
875
+  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',20,'f','2015-10-28 20:09:47.652846','2015-10-28 20:09:47.652846','chartreuse')
876
+ Testing Load (0.2ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
877
+  (0.5ms) rollback transaction
878
+  (0.0ms) begin transaction
879
+ ----------------------------------------------------------------------------
880
+ BulkInsertWorkerTest: test_pending_count_should_describe_size_of_pending_set
881
+ ----------------------------------------------------------------------------
882
+  (0.0ms) rollback transaction
1217
883
   (0.1ms) begin transaction
884
+ -------------------------------------------------------------------
885
+ BulkInsertWorkerTest: test_save!_when_not_pending_should_do_nothing
886
+ -------------------------------------------------------------------
887
+  (0.1ms) SELECT COUNT(*) FROM "testings"
888
+  (0.1ms) SELECT COUNT(*) FROM "testings"
889
+  (0.1ms) rollback transaction
890
+  (0.0ms) begin transaction
1218
891
  --------------------------------------------------------------------
1219
892
  BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
1220
893
  --------------------------------------------------------------------
1221
894
   (0.1ms) rollback transaction
1222
895
   (0.1ms) begin transaction
896
+ ------------------------------------------------------------------------------
897
+ BulkInsertWorkerTest: test_add_should_use_database_default_values_when_present
898
+ ------------------------------------------------------------------------------
899
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',20,'f','2015-10-28 20:09:47.660440','2015-10-28 20:09:47.660440','chartreuse')
900
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
901
+  (0.4ms) rollback transaction
902
+  (0.1ms) begin transaction
1223
903
  ----------------------------------------------------------------------------------
1224
904
  BulkInsertWorkerTest: test_add_should_save_automatically_when_overflowing_set_size
1225
905
  ----------------------------------------------------------------------------------
1226
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-09 14:46:00.225847','2015-10-09 14:46:00.225847')
906
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2015-10-28 20:09:47.662496','2015-10-28 20:09:47.662496','chartreuse')
1227
907
   (0.0ms) SELECT COUNT(*) FROM "testings"
1228
908
  Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
1229
-  (1.6ms) rollback transaction
1230
-  (0.1ms) begin transaction
1231
- ----------------------------------------------------------------
1232
- BulkInsertWorkerTest: test_add_should_allow_values_given_as_Hash
1233
- ----------------------------------------------------------------
1234
-  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Yo',20,'f','2015-10-09 14:46:00.229546','2015-10-09 14:46:00.229546')
1235
- Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
1236
-  (0.5ms) rollback transaction
909
+  (0.4ms) rollback transaction
1237
910
   (0.1ms) begin transaction
1238
- -------------------------------------------------------------------
1239
- BulkInsertWorkerTest: test_save!_when_not_pending_should_do_nothing
1240
- -------------------------------------------------------------------
1241
-  (0.1ms) SELECT COUNT(*) FROM "testings"
1242
-  (0.1ms) SELECT COUNT(*) FROM "testings"
911
+ ------------------------------------------------------
912
+ BulkInsertWorkerTest: test_empty_insert_is_not_pending
913
+ ------------------------------------------------------
1243
914
   (0.0ms) rollback transaction
1244
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1245
915
   (0.1ms) begin transaction
1246
- ----------------------------------------------------------------
1247
- BulkInsertWorkerTest: test_add_should_allow_values_given_as_Hash
1248
- ----------------------------------------------------------------
1249
-  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Yo',20,'f','2015-10-09 14:48:19.244536','2015-10-09 14:48:19.244536')
1250
- Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
1251
-  (2.9ms) rollback transaction
916
+ ----------------------------------------------------------------------------------------------
917
+ BulkInsertWorkerTest: test_default_timestamp_columns_should_be_equivalent_for_the_entire_batch
918
+ ----------------------------------------------------------------------------------------------
919
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2015-10-28 20:09:47.665254','2015-10-28 20:09:47.665254','chartreuse'),('Howdy',20,'f','2015-10-28 20:09:47.665254','2015-10-28 20:09:47.665254','chartreuse')
920
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings"
921
+  (0.4ms) rollback transaction
1252
922
   (0.1ms) begin transaction
1253
- -------------------------------------------------------------------------------
1254
- BulkInsertWorkerTest: test_add_should_default_timestamp_columns_to_current_time
1255
- -------------------------------------------------------------------------------
1256
-  (0.4ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-09 14:48:19.256256','2015-10-09 14:48:19.256257')
1257
- Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
923
+ ---------------------------------------------------------
924
+ BulkInsertWorkerTest: test_save!_makes_insert_not_pending
925
+ ---------------------------------------------------------
926
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2015-10-28 20:09:47.667102','2015-10-28 20:09:47.667102','chartreuse')
927
+  (0.4ms) rollback transaction
928
+  (0.1ms) begin transaction
929
+ --------------------------------------------------------
930
+ BulkInsertWorkerTest: test_save!_inserts_pending_records
931
+ --------------------------------------------------------
932
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',15,'f','2015-10-28 20:09:47.668436','2015-10-28 20:09:47.668436','chartreuse'),('Hello',25,'t','2015-10-28 20:09:47.668436','2015-10-28 20:09:47.668436','chartreuse')
933
+ Testing Load (0.3ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
934
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
1258
935
   (0.5ms) rollback transaction
936
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
937
+  (0.1ms) begin transaction
938
+ ----------------------------------------------------------------------------------------------
939
+ BulkInsertWorkerTest: test_default_timestamp_columns_should_be_equivalent_for_the_entire_batch
940
+ ----------------------------------------------------------------------------------------------
941
+  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2015-10-28 20:11:03.358340','2015-10-28 20:11:03.358340','chartreuse'),('Howdy',20,'f','2015-10-28 20:11:03.358340','2015-10-28 20:11:03.358340','chartreuse')
942
+ Testing Load (0.2ms) SELECT "testings".* FROM "testings"
943
+  (2.2ms) rollback transaction
1259
944
   (0.1ms) begin transaction
1260
- ------------------------------------------------------
1261
- BulkInsertWorkerTest: test_empty_insert_is_not_pending
1262
- ------------------------------------------------------
1263
-  (0.0ms) rollback transaction
1264
-  (0.0ms) begin transaction
1265
945
  -------------------------------------------
1266
946
  BulkInsertWorkerTest: test_default_set_size
1267
947
  -------------------------------------------
1268
-  (0.0ms) rollback transaction
1269
-  (0.1ms) begin transaction
1270
- --------------------------------------------------------------------
1271
- BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
1272
- --------------------------------------------------------------------
1273
-  (0.0ms) rollback transaction
1274
-  (0.1ms) begin transaction
948
+  (0.1ms) rollback transaction
949
+  (0.0ms) begin transaction
1275
950
  -------------------------------------------------------------------
1276
951
  BulkInsertWorkerTest: test_save!_when_not_pending_should_do_nothing
1277
952
  -------------------------------------------------------------------
1278
953
   (0.1ms) SELECT COUNT(*) FROM "testings"
1279
-  (0.0ms) SELECT COUNT(*) FROM "testings"
954
+  (0.1ms) SELECT COUNT(*) FROM "testings"
1280
955
   (0.1ms) rollback transaction
956
+  (0.0ms) begin transaction
957
+ ---------------------------------------------------------------------
958
+ BulkInsertWorkerTest: test_add_all_should_append_all_items_to_the_set
959
+ ---------------------------------------------------------------------
960
+  (0.0ms) rollback transaction
1281
961
   (0.1ms) begin transaction
1282
- --------------------------------------------------------
1283
- BulkInsertWorkerTest: test_save!_inserts_pending_records
1284
- --------------------------------------------------------
1285
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Yo',15,'f','2015-10-09 14:48:19.262675','2015-10-09 14:48:19.262675'),('Hello',25,'t','2015-10-09 14:48:19.262675','2015-10-09 14:48:19.262675')
1286
- Testing Load (0.1ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
1287
- Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
1288
-  (0.6ms) rollback transaction
1289
-  (0.1ms) begin transaction
1290
- ---------------------------------------------------------
1291
- BulkInsertWorkerTest: test_save!_makes_insert_not_pending
1292
- ---------------------------------------------------------
1293
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-09 14:48:19.268550','2015-10-09 14:48:19.268550')
1294
-  (0.4ms) rollback transaction
962
+ ------------------------------------------------------
963
+ BulkInsertWorkerTest: test_empty_insert_is_not_pending
964
+ ------------------------------------------------------
965
+  (0.0ms) rollback transaction
1295
966
   (0.1ms) begin transaction
1296
967
  ----------------------------------------------------------------------------------
1297
968
  BulkInsertWorkerTest: test_add_should_save_automatically_when_overflowing_set_size
1298
969
  ----------------------------------------------------------------------------------
1299
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-09 14:48:19.270250','2015-10-09 14:48:19.270250')
1300
-  (0.1ms) SELECT COUNT(*) FROM "testings"
970
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2015-10-28 20:11:03.381652','2015-10-28 20:11:03.381652','chartreuse')
971
+  (0.0ms) SELECT COUNT(*) FROM "testings"
1301
972
  Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
1302
973
   (0.4ms) rollback transaction
1303
-  (0.0ms) begin transaction
1304
- ---------------------------------------------------------------
1305
- BulkInsertTest: test_bulk_insert_with_block_should_yield_worker
1306
- ---------------------------------------------------------------
1307
-  (0.0ms) SAVEPOINT active_record_1
1308
-  (0.0ms) RELEASE SAVEPOINT active_record_1
1309
-  (0.0ms) rollback transaction
1310
974
   (0.1ms) begin transaction
1311
- ---------------------------------------------------------------------
1312
- BulkInsertTest: test_bulk_insert_with_block_should_save_automatically
1313
- ---------------------------------------------------------------------
1314
-  (0.1ms) SELECT COUNT(*) FROM "testings"
1315
-  (0.0ms) SAVEPOINT active_record_1
1316
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',NULL,NULL,'2015-10-09 14:48:19.274780','2015-10-09 14:48:19.274782')
1317
-  (0.0ms) RELEASE SAVEPOINT active_record_1
1318
-  (0.0ms) SELECT COUNT(*) FROM "testings"
1319
-  (1.5ms) rollback transaction
975
+ ----------------------------------------------------------------
976
+ BulkInsertWorkerTest: test_explicit_nil_should_override_defaults
977
+ ----------------------------------------------------------------
978
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',20,'f','2015-10-28 20:11:03.384868','2015-10-28 20:11:03.384868',NULL)
979
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
980
+  (0.4ms) rollback transaction
981
+  (0.1ms) begin transaction
982
+ ---------------------------------------------------------
983
+ BulkInsertWorkerTest: test_save!_makes_insert_not_pending
984
+ ---------------------------------------------------------
985
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2015-10-28 20:11:03.386677','2015-10-28 20:11:03.386677','chartreuse')
986
+  (0.4ms) rollback transaction
1320
987
   (0.1ms) begin transaction
1321
- -------------------------------------------------------------------
1322
- BulkInsertTest: test_bulk_insert_without_block_should_return_worker
1323
- -------------------------------------------------------------------
988
+ --------------------------------------------------------------------
989
+ BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
990
+ --------------------------------------------------------------------
1324
991
   (0.0ms) rollback transaction
1325
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1326
992
   (0.1ms) begin transaction
1327
- ---------------------------------------------------------------------
1328
- BulkInsertTest: test_bulk_insert_with_block_should_save_automatically
1329
- ---------------------------------------------------------------------
1330
-  (0.1ms) SELECT COUNT(*) FROM "testings"
1331
-  (0.0ms) SAVEPOINT active_record_1
1332
-  (1.5ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',NULL,NULL,'2015-10-09 14:54:29.775395','2015-10-09 14:54:29.775397')
1333
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1334
-  (0.1ms) SELECT COUNT(*) FROM "testings"
1335
-  (1.9ms) rollback transaction
993
+ --------------------------------------------------------
994
+ BulkInsertWorkerTest: test_save!_inserts_pending_records
995
+ --------------------------------------------------------
996
+  (0.4ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',15,'f','2015-10-28 20:11:03.390135','2015-10-28 20:11:03.390135','chartreuse'),('Hello',25,'t','2015-10-28 20:11:03.390135','2015-10-28 20:11:03.390135','chartreuse')
997
+ Testing Load (0.2ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
998
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
999
+  (0.4ms) rollback transaction
1336
1000
   (0.1ms) begin transaction
1337
- -------------------------------------------------------------------
1338
- BulkInsertTest: test_bulk_insert_without_block_should_return_worker
1339
- -------------------------------------------------------------------
1001
+ ----------------------------------------------------------------------------
1002
+ BulkInsertWorkerTest: test_pending_count_should_describe_size_of_pending_set
1003
+ ----------------------------------------------------------------------------
1340
1004
   (0.0ms) rollback transaction
1341
1005
   (0.1ms) begin transaction
1342
- ---------------------------------------------------------------
1343
- BulkInsertTest: test_bulk_insert_with_block_should_yield_worker
1344
- ---------------------------------------------------------------
1345
-  (0.0ms) SAVEPOINT active_record_1
1346
-  (0.0ms) RELEASE SAVEPOINT active_record_1
1347
-  (0.0ms) rollback transaction
1348
-  (0.0ms) begin transaction
1349
- --------------------------------------------------------------------
1350
- BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
1351
- --------------------------------------------------------------------
1352
-  (0.0ms) rollback transaction
1006
+ ----------------------------------------------------------------
1007
+ BulkInsertWorkerTest: test_add_should_allow_values_given_as_Hash
1008
+ ----------------------------------------------------------------
1009
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',20,'f','2015-10-28 20:11:03.398277','2015-10-28 20:11:03.398277','chartreuse')
1010
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
1011
+  (0.4ms) rollback transaction
1353
1012
   (0.1ms) begin transaction
1354
1013
  -------------------------------------------------------------------------------
1355
1014
  BulkInsertWorkerTest: test_add_should_default_timestamp_columns_to_current_time
1356
1015
  -------------------------------------------------------------------------------
1357
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-09 14:54:29.786767','2015-10-09 14:54:29.786768')
1016
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2015-10-28 20:11:03.400450','2015-10-28 20:11:03.400450','chartreuse')
1358
1017
  Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
1359
1018
   (0.5ms) rollback transaction
1360
1019
   (0.1ms) begin transaction
1361
- ----------------------------------------------------------------
1362
- BulkInsertWorkerTest: test_add_should_allow_values_given_as_Hash
1363
- ----------------------------------------------------------------
1364
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Yo',20,'f','2015-10-09 14:54:29.794916','2015-10-09 14:54:29.794916')
1020
+ ------------------------------------------------------------------------------
1021
+ BulkInsertWorkerTest: test_add_should_use_database_default_values_when_present
1022
+ ------------------------------------------------------------------------------
1023
+  (0.4ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',20,'f','2015-10-28 20:11:03.403756','2015-10-28 20:11:03.403756','chartreuse')
1365
1024
  Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
1366
1025
   (0.4ms) rollback transaction
1367
1026
   (0.1ms) begin transaction
1368
- --------------------------------------------------------
1369
- BulkInsertWorkerTest: test_save!_inserts_pending_records
1370
- --------------------------------------------------------
1371
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Yo',15,'f','2015-10-09 14:54:29.797049','2015-10-09 14:54:29.797049'),('Hello',25,'t','2015-10-09 14:54:29.797049','2015-10-09 14:54:29.797049')
1372
- Testing Load (0.1ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
1373
- Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
1374
-  (0.6ms) rollback transaction
1027
+ ------------------------------------------------------------------------------
1028
+ BulkInsertTest: test_default_bulk_columns_should_return_all_columns_without_id
1029
+ ------------------------------------------------------------------------------
1030
+  (0.0ms) rollback transaction
1031
+  (0.1ms) begin transaction
1032
+ ---------------------------------------------------------------
1033
+ BulkInsertTest: test_bulk_insert_with_block_should_yield_worker
1034
+ ---------------------------------------------------------------
1035
+  (0.0ms) SAVEPOINT active_record_1
1036
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1037
+  (0.0ms) rollback transaction
1038
+  (0.1ms) begin transaction
1039
+ -----------------------------------------------------------------------------
1040
+ BulkInsertTest: test_bulk_insert_with_array_should_save_the_array_immediately
1041
+ -----------------------------------------------------------------------------
1042
+  (0.1ms) SELECT COUNT(*) FROM "testings"
1043
+  (0.0ms) SAVEPOINT active_record_1
1044
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','green','2015-10-28 20:11:03.408978','chartreuse'),('Hey',20,'f','2015-10-28 20:11:03.408978','2015-10-28 20:11:03.408978','chartreuse')
1045
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1046
+  (0.0ms) SELECT COUNT(*) FROM "testings"
1047
+  (0.4ms) rollback transaction
1375
1048
   (0.1ms) begin transaction
1049
+ ---------------------------------------------------------------------
1050
+ BulkInsertTest: test_bulk_insert_with_block_should_save_automatically
1051
+ ---------------------------------------------------------------------
1052
+  (0.1ms) SELECT COUNT(*) FROM "testings"
1053
+  (0.0ms) SAVEPOINT active_record_1
1054
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',NULL,NULL,'2015-10-28 20:11:03.411309','2015-10-28 20:11:03.411309','chartreuse')
1055
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1056
+  (0.1ms) SELECT COUNT(*) FROM "testings"
1057
+  (0.4ms) rollback transaction
1058
+  (0.1ms) begin transaction
1376
1059
  -------------------------------------------------------------------
1377
- BulkInsertWorkerTest: test_save!_when_not_pending_should_do_nothing
1060
+ BulkInsertTest: test_bulk_insert_without_block_should_return_worker
1378
1061
  -------------------------------------------------------------------
1379
-  (0.0ms) SELECT COUNT(*) FROM "testings"
1380
-  (0.0ms) SELECT COUNT(*) FROM "testings"
1381
-  (0.1ms) rollback transaction
1062
+  (0.0ms) rollback transaction
1063
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1382
1064
   (0.1ms) begin transaction
1383
- -------------------------------------------
1384
- BulkInsertWorkerTest: test_default_set_size
1385
- -------------------------------------------
1386
-  (0.1ms) rollback transaction
1065
+ ---------------------------------------------------------------------
1066
+ BulkInsertWorkerTest: test_add_all_should_append_all_items_to_the_set
1067
+ ---------------------------------------------------------------------
1068
+  (0.0ms) rollback transaction
1387
1069
   (0.0ms) begin transaction
1388
1070
  ----------------------------------------------------------------------------------
1389
1071
  BulkInsertWorkerTest: test_add_should_save_automatically_when_overflowing_set_size
1390
1072
  ----------------------------------------------------------------------------------
1391
-  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-09 14:54:29.806465','2015-10-09 14:54:29.806465')
1073
+  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2015-10-28 20:12:47.479586','2015-10-28 20:12:47.479586','chartreuse')
1392
1074
   (0.1ms) SELECT COUNT(*) FROM "testings"
1393
1075
  Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
1394
-  (0.4ms) rollback transaction
1076
+  (2.4ms) rollback transaction
1077
+  (0.1ms) begin transaction
1078
+ -------------------------------------------------------------------
1079
+ BulkInsertWorkerTest: test_save!_when_not_pending_should_do_nothing
1080
+ -------------------------------------------------------------------
1081
+  (0.1ms) SELECT COUNT(*) FROM "testings"
1082
+  (0.1ms) SELECT COUNT(*) FROM "testings"
1083
+  (0.1ms) rollback transaction
1395
1084
   (0.0ms) begin transaction
1396
- ---------------------------------------------------------
1397
- BulkInsertWorkerTest: test_save!_makes_insert_not_pending
1398
- ---------------------------------------------------------
1399
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-09 14:54:29.809471','2015-10-09 14:54:29.809471')
1400
-  (0.4ms) rollback transaction
1401
-  (0.1ms) begin transaction
1402
- ------------------------------------------------------
1403
- BulkInsertWorkerTest: test_empty_insert_is_not_pending
1404
- ------------------------------------------------------
1405
-  (0.1ms) rollback transaction
1406
- ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
1407
-  (0.1ms) begin transaction
1408
- ------------------------------------------------------
1409
- BulkInsertWorkerTest: test_empty_insert_is_not_pending
1410
- ------------------------------------------------------
1411
-  (0.1ms) rollback transaction
1085
+ --------------------------------------------------------
1086
+ BulkInsertWorkerTest: test_save!_inserts_pending_records
1087
+ --------------------------------------------------------
1088
+  (0.5ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',15,'f','2015-10-28 20:12:47.502465','2015-10-28 20:12:47.502465','chartreuse'),('Hello',25,'t','2015-10-28 20:12:47.502465','2015-10-28 20:12:47.502465','chartreuse')
1089
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
1090
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
1091
+  (0.5ms) rollback transaction
1412
1092
   (0.1ms) begin transaction
1413
1093
  -------------------------------------------------------------------------------
1414
1094
  BulkInsertWorkerTest: test_add_should_default_timestamp_columns_to_current_time
1415
1095
  -------------------------------------------------------------------------------
1416
-  (1.1ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-09 17:03:16.852866','2015-10-09 17:03:16.852867')
1096
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2015-10-28 20:12:47.511412','2015-10-28 20:12:47.511412','chartreuse')
1417
1097
  Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
1418
-  (0.5ms) rollback transaction
1098
+  (0.4ms) rollback transaction
1099
+  (0.0ms) begin transaction
1100
+ ----------------------------------------------------------------------------------------------
1101
+ BulkInsertWorkerTest: test_default_timestamp_columns_should_be_equivalent_for_the_entire_batch
1102
+ ----------------------------------------------------------------------------------------------
1103
+  (0.4ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2015-10-28 20:12:47.514036','2015-10-28 20:12:47.514036','chartreuse'),('Howdy',20,'f','2015-10-28 20:12:47.514036','2015-10-28 20:12:47.514036','chartreuse')
1104
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings"
1105
+  (0.4ms) rollback transaction
1106
+  (0.1ms) begin transaction
1107
+ ----------------------------------------------------------------
1108
+ BulkInsertWorkerTest: test_explicit_nil_should_override_defaults
1109
+ ----------------------------------------------------------------
1110
+  (0.7ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',20,'f','2015-10-28 20:12:47.516777','2015-10-28 20:12:47.516777',NULL)
1111
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
1112
+  (0.4ms) rollback transaction
1419
1113
   (0.1ms) begin transaction
1420
1114
  ---------------------------------------------------------
1421
1115
  BulkInsertWorkerTest: test_save!_makes_insert_not_pending
1422
1116
  ---------------------------------------------------------
1423
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-09 17:03:16.863828','2015-10-09 17:03:16.863828')
1117
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2015-10-28 20:12:47.519576','2015-10-28 20:12:47.519576','chartreuse')
1424
1118
   (0.4ms) rollback transaction
1425
1119
   (0.1ms) begin transaction
1120
+ ------------------------------------------------------------------------------
1121
+ BulkInsertWorkerTest: test_add_should_use_database_default_values_when_present
1122
+ ------------------------------------------------------------------------------
1123
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',20,'f','2015-10-28 20:12:47.521107','2015-10-28 20:12:47.521107','chartreuse')
1124
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
1125
+  (0.3ms) rollback transaction
1126
+  (0.1ms) begin transaction
1426
1127
  ----------------------------------------------------------------
1427
1128
  BulkInsertWorkerTest: test_add_should_allow_values_given_as_Hash
1428
1129
  ----------------------------------------------------------------
1429
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Yo',20,'f','2015-10-09 17:03:16.865241','2015-10-09 17:03:16.865241')
1430
- Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
1130
+  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',20,'f','2015-10-28 20:12:47.522973','2015-10-28 20:12:47.522973','chartreuse')
1131
+ Testing Load (0.2ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
1431
1132
   (0.5ms) rollback transaction
1432
1133
   (0.1ms) begin transaction
1433
- ----------------------------------------------------------------------------------
1434
- BulkInsertWorkerTest: test_add_should_save_automatically_when_overflowing_set_size
1435
- ----------------------------------------------------------------------------------
1436
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-09 17:03:16.867520','2015-10-09 17:03:16.867520')
1437
-  (0.1ms) SELECT COUNT(*) FROM "testings"
1438
- Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
1439
-  (0.5ms) rollback transaction
1440
-  (0.1ms) begin transaction
1441
- --------------------------------------------------------
1442
- BulkInsertWorkerTest: test_save!_inserts_pending_records
1443
- --------------------------------------------------------
1444
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Yo',15,'f','2015-10-09 17:03:16.870060','2015-10-09 17:03:16.870060'),('Hello',25,'t','2015-10-09 17:03:16.870060','2015-10-09 17:03:16.870060')
1445
- Testing Load (0.1ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
1446
- Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
1447
-  (0.6ms) rollback transaction
1448
-  (0.1ms) begin transaction
1134
+ ----------------------------------------------------------------------------
1135
+ BulkInsertWorkerTest: test_pending_count_should_describe_size_of_pending_set
1136
+ ----------------------------------------------------------------------------
1137
+  (0.0ms) rollback transaction
1138
+  (0.0ms) begin transaction
1449
1139
  --------------------------------------------------------------------
1450
1140
  BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
1451
1141
  --------------------------------------------------------------------
1452
-  (0.1ms) rollback transaction
1453
-  (0.1ms) begin transaction
1454
- -------------------------------------------------------------------
1455
- BulkInsertWorkerTest: test_save!_when_not_pending_should_do_nothing
1456
- -------------------------------------------------------------------
1457
-  (0.1ms) SELECT COUNT(*) FROM "testings"
1458
-  (0.0ms) SELECT COUNT(*) FROM "testings"
1459
1142
   (0.0ms) rollback transaction
1460
-  (0.1ms) begin transaction
1143
+  (0.0ms) begin transaction
1461
1144
  -------------------------------------------
1462
1145
  BulkInsertWorkerTest: test_default_set_size
1463
1146
  -------------------------------------------
1147
+  (0.0ms) rollback transaction
1148
+  (0.1ms) begin transaction
1149
+ ------------------------------------------------------
1150
+ BulkInsertWorkerTest: test_empty_insert_is_not_pending
1151
+ ------------------------------------------------------
1464
1152
   (0.0ms) rollback transaction
1465
1153
   (0.0ms) begin transaction
1154
+ -----------------------------------------------------------------------------
1155
+ BulkInsertTest: test_bulk_insert_with_array_should_save_the_array_immediately
1156
+ -----------------------------------------------------------------------------
1157
+  (0.1ms) SELECT COUNT(*) FROM "testings"
1158
+  (0.0ms) SAVEPOINT active_record_1
1159
+  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','green','2015-10-28 20:12:47.530685','chartreuse'),('Hey',20,'f','2015-10-28 20:12:47.530685','2015-10-28 20:12:47.530685','chartreuse')
1160
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1161
+  (0.1ms) SELECT COUNT(*) FROM "testings"
1162
+  (0.3ms) rollback transaction
1163
+  (0.1ms) begin transaction
1164
+ ---------------------------------------------------------------------
1165
+ BulkInsertTest: test_bulk_insert_with_block_should_save_automatically
1166
+ ---------------------------------------------------------------------
1167
+  (0.1ms) SELECT COUNT(*) FROM "testings"
1168
+  (0.0ms) SAVEPOINT active_record_1
1169
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',NULL,NULL,'2015-10-28 20:12:47.533152','2015-10-28 20:12:47.533152','chartreuse')
1170
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1171
+  (0.1ms) SELECT COUNT(*) FROM "testings"
1172
+  (0.4ms) rollback transaction
1173
+  (0.1ms) begin transaction
1466
1174
  -------------------------------------------------------------------
1467
1175
  BulkInsertTest: test_bulk_insert_without_block_should_return_worker
1468
1176
  -------------------------------------------------------------------
@@ -1471,50 +1179,104 @@ BulkInsertTest: test_bulk_insert_without_block_should_return_worker
1471
1179
  ---------------------------------------------------------------
1472
1180
  BulkInsertTest: test_bulk_insert_with_block_should_yield_worker
1473
1181
  ---------------------------------------------------------------
1474
-  (0.0ms) SAVEPOINT active_record_1
1182
+  (0.1ms) SAVEPOINT active_record_1
1475
1183
   (0.0ms) RELEASE SAVEPOINT active_record_1
1476
1184
   (0.0ms) rollback transaction
1477
1185
   (0.1ms) begin transaction
1186
+ ------------------------------------------------------------------------------
1187
+ BulkInsertTest: test_default_bulk_columns_should_return_all_columns_without_id
1188
+ ------------------------------------------------------------------------------
1189
+  (0.0ms) rollback transaction
1190
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1191
+  (0.1ms) begin transaction
1192
+ -----------------------------------------------------------------------------
1193
+ BulkInsertTest: test_bulk_insert_with_array_should_save_the_array_immediately
1194
+ -----------------------------------------------------------------------------
1195
+  (0.1ms) SELECT COUNT(*) FROM "testings"
1196
+  (0.0ms) SAVEPOINT active_record_1
1197
+  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','green','2015-10-28 20:13:22.448075','chartreuse'),('Hey',20,'f','2015-10-28 20:13:22.448075','2015-10-28 20:13:22.448075','chartreuse')
1198
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1199
+  (0.1ms) SELECT COUNT(*) FROM "testings"
1200
+  (2.0ms) rollback transaction
1201
+  (0.1ms) begin transaction
1202
+ ------------------------------------------------------------------------------
1203
+ BulkInsertTest: test_default_bulk_columns_should_return_all_columns_without_id
1204
+ ------------------------------------------------------------------------------
1205
+  (0.0ms) rollback transaction
1206
+  (0.1ms) begin transaction
1478
1207
  ---------------------------------------------------------------------
1479
1208
  BulkInsertTest: test_bulk_insert_with_block_should_save_automatically
1480
1209
  ---------------------------------------------------------------------
1481
1210
   (0.1ms) SELECT COUNT(*) FROM "testings"
1482
-  (0.1ms) SAVEPOINT active_record_1
1483
-  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',NULL,NULL,'2015-10-09 17:03:16.884635','2015-10-09 17:03:16.884637')
1211
+  (0.0ms) SAVEPOINT active_record_1
1212
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',NULL,NULL,'2015-10-28 20:13:22.454687','2015-10-28 20:13:22.454687','chartreuse')
1484
1213
   (0.0ms) RELEASE SAVEPOINT active_record_1
1485
-  (0.1ms) SELECT COUNT(*) FROM "testings"
1486
-  (0.5ms) rollback transaction
1487
- ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
1214
+  (0.0ms) SELECT COUNT(*) FROM "testings"
1215
+  (0.4ms) rollback transaction
1488
1216
   (0.1ms) begin transaction
1489
- --------------------------------------------------------
1490
- BulkInsertWorkerTest: test_save!_inserts_pending_records
1491
- --------------------------------------------------------
1492
-  (1.0ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Yo',15,'f','2015-10-09 18:49:52.551285','2015-10-09 18:49:52.551285'),('Hello',25,'t','2015-10-09 18:49:52.551285','2015-10-09 18:49:52.551285')
1493
- Testing Load (0.2ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
1494
- Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
1495
-  (0.5ms) rollback transaction
1496
-  (0.1ms) begin transaction
1497
- ----------------------------------------------------------------------------------
1498
- BulkInsertWorkerTest: test_add_should_save_automatically_when_overflowing_set_size
1499
- ----------------------------------------------------------------------------------
1500
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-09 18:49:52.569935','2015-10-09 18:49:52.569935')
1501
-  (0.1ms) SELECT COUNT(*) FROM "testings"
1502
- Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
1503
-  (0.5ms) rollback transaction
1217
+ -------------------------------------------------------------------
1218
+ BulkInsertTest: test_bulk_insert_without_block_should_return_worker
1219
+ -------------------------------------------------------------------
1220
+  (0.0ms) rollback transaction
1221
+  (0.0ms) begin transaction
1222
+ ---------------------------------------------------------------
1223
+ BulkInsertTest: test_bulk_insert_with_block_should_yield_worker
1224
+ ---------------------------------------------------------------
1225
+  (0.0ms) SAVEPOINT active_record_1
1226
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1227
+  (0.0ms) rollback transaction
1228
+  (0.0ms) begin transaction
1229
+ ---------------------------------------------------------------------
1230
+ BulkInsertWorkerTest: test_add_all_should_append_all_items_to_the_set
1231
+ ---------------------------------------------------------------------
1232
+  (0.0ms) rollback transaction
1504
1233
   (0.1ms) begin transaction
1505
1234
  ---------------------------------------------------------
1506
1235
  BulkInsertWorkerTest: test_save!_makes_insert_not_pending
1507
1236
  ---------------------------------------------------------
1508
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-09 18:49:52.572592','2015-10-09 18:49:52.572592')
1509
-  (0.4ms) rollback transaction
1237
+  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2015-10-28 20:13:22.460810','2015-10-28 20:13:22.460810','chartreuse')
1238
+  (0.3ms) rollback transaction
1239
+  (0.1ms) begin transaction
1240
+ ----------------------------------------------------------------
1241
+ BulkInsertWorkerTest: test_add_should_allow_values_given_as_Hash
1242
+ ----------------------------------------------------------------
1243
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',20,'f','2015-10-28 20:13:22.462862','2015-10-28 20:13:22.462862','chartreuse')
1244
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
1245
+  (0.5ms) rollback transaction
1510
1246
   (0.1ms) begin transaction
1511
1247
  -------------------------------------------------------------------------------
1512
1248
  BulkInsertWorkerTest: test_add_should_default_timestamp_columns_to_current_time
1513
1249
  -------------------------------------------------------------------------------
1514
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',15,'t','2015-10-09 18:49:52.574026','2015-10-09 18:49:52.574028')
1250
+  (0.4ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2015-10-28 20:13:22.479273','2015-10-28 20:13:22.479273','chartreuse')
1251
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
1252
+  (0.4ms) rollback transaction
1253
+  (0.0ms) begin transaction
1254
+ ----------------------------------------------------------------------------------------------
1255
+ BulkInsertWorkerTest: test_default_timestamp_columns_should_be_equivalent_for_the_entire_batch
1256
+ ----------------------------------------------------------------------------------------------
1257
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2015-10-28 20:13:22.481957','2015-10-28 20:13:22.481957','chartreuse'),('Howdy',20,'f','2015-10-28 20:13:22.481957','2015-10-28 20:13:22.481957','chartreuse')
1258
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings"
1259
+  (0.4ms) rollback transaction
1260
+  (0.1ms) begin transaction
1261
+ -------------------------------------------------------------------
1262
+ BulkInsertWorkerTest: test_save!_when_not_pending_should_do_nothing
1263
+ -------------------------------------------------------------------
1264
+  (0.1ms) SELECT COUNT(*) FROM "testings"
1265
+  (0.1ms) SELECT COUNT(*) FROM "testings"
1266
+  (0.1ms) rollback transaction
1267
+  (0.1ms) begin transaction
1268
+ ----------------------------------------------------------------
1269
+ BulkInsertWorkerTest: test_explicit_nil_should_override_defaults
1270
+ ----------------------------------------------------------------
1271
+  (0.4ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',20,'f','2015-10-28 20:13:22.486828','2015-10-28 20:13:22.486828',NULL)
1515
1272
  Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
1516
1273
   (0.4ms) rollback transaction
1517
1274
   (0.1ms) begin transaction
1275
+ --------------------------------------------------------------------
1276
+ BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
1277
+ --------------------------------------------------------------------
1278
+  (0.0ms) rollback transaction
1279
+  (0.0ms) begin transaction
1518
1280
  ------------------------------------------------------
1519
1281
  BulkInsertWorkerTest: test_empty_insert_is_not_pending
1520
1282
  ------------------------------------------------------
@@ -1525,43 +1287,30 @@ BulkInsertWorkerTest: test_default_set_size
1525
1287
  -------------------------------------------
1526
1288
   (0.0ms) rollback transaction
1527
1289
   (0.1ms) begin transaction
1528
- -------------------------------------------------------------------
1529
- BulkInsertWorkerTest: test_save!_when_not_pending_should_do_nothing
1530
- -------------------------------------------------------------------
1531
-  (0.0ms) SELECT COUNT(*) FROM "testings"
1532
-  (0.0ms) SELECT COUNT(*) FROM "testings"
1533
-  (0.0ms) rollback transaction
1534
-  (0.1ms) begin transaction
1535
- --------------------------------------------------------------------
1536
- BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
1537
- --------------------------------------------------------------------
1538
-  (0.0ms) rollback transaction
1539
-  (0.1ms) begin transaction
1540
- ----------------------------------------------------------------
1541
- BulkInsertWorkerTest: test_add_should_allow_values_given_as_Hash
1542
- ----------------------------------------------------------------
1543
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Yo',20,'f','2015-10-09 18:49:52.579549','2015-10-09 18:49:52.579549')
1290
+ --------------------------------------------------------
1291
+ BulkInsertWorkerTest: test_save!_inserts_pending_records
1292
+ --------------------------------------------------------
1293
+  (0.4ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',15,'f','2015-10-28 20:13:22.491382','2015-10-28 20:13:22.491382','chartreuse'),('Hello',25,'t','2015-10-28 20:13:22.491382','2015-10-28 20:13:22.491382','chartreuse')
1294
+ Testing Load (0.2ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
1295
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
1296
+  (0.5ms) rollback transaction
1297
+  (0.1ms) begin transaction
1298
+ ------------------------------------------------------------------------------
1299
+ BulkInsertWorkerTest: test_add_should_use_database_default_values_when_present
1300
+ ------------------------------------------------------------------------------
1301
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',20,'f','2015-10-28 20:13:22.498646','2015-10-28 20:13:22.498646','chartreuse')
1302
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
1303
+  (0.4ms) rollback transaction
1304
+  (0.1ms) begin transaction
1305
+ ----------------------------------------------------------------------------------
1306
+ BulkInsertWorkerTest: test_add_should_save_automatically_when_overflowing_set_size
1307
+ ----------------------------------------------------------------------------------
1308
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2015-10-28 20:13:22.500561','2015-10-28 20:13:22.500561','chartreuse')
1309
+  (0.1ms) SELECT COUNT(*) FROM "testings"
1544
1310
  Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
1545
-  (0.5ms) rollback transaction
1311
+  (0.4ms) rollback transaction
1546
1312
   (0.1ms) begin transaction
1547
- -------------------------------------------------------------------
1548
- BulkInsertTest: test_bulk_insert_without_block_should_return_worker
1549
- -------------------------------------------------------------------
1313
+ ----------------------------------------------------------------------------
1314
+ BulkInsertWorkerTest: test_pending_count_should_describe_size_of_pending_set
1315
+ ----------------------------------------------------------------------------
1550
1316
   (0.1ms) rollback transaction
1551
-  (0.0ms) begin transaction
1552
- ---------------------------------------------------------------
1553
- BulkInsertTest: test_bulk_insert_with_block_should_yield_worker
1554
- ---------------------------------------------------------------
1555
-  (0.0ms) SAVEPOINT active_record_1
1556
-  (0.0ms) RELEASE SAVEPOINT active_record_1
1557
-  (0.0ms) rollback transaction
1558
-  (0.1ms) begin transaction
1559
- ---------------------------------------------------------------------
1560
- BulkInsertTest: test_bulk_insert_with_block_should_save_automatically
1561
- ---------------------------------------------------------------------
1562
-  (0.2ms) SELECT COUNT(*) FROM "testings"
1563
-  (0.0ms) SAVEPOINT active_record_1
1564
-  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at") VALUES ('Hello',NULL,NULL,'2015-10-09 18:49:52.598942','2015-10-09 18:49:52.598944')
1565
-  (0.0ms) RELEASE SAVEPOINT active_record_1
1566
-  (0.0ms) SELECT COUNT(*) FROM "testings"
1567
-  (0.5ms) rollback transaction