bulk_insert 1.8.0 → 1.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7f92126ff36c331b40bfc5ca7d261af01410963a5c9dab65824a64f36405e102
4
- data.tar.gz: ef41beaeb0f13ff251818e0a57c0e729f2a3bf520d536a24182c2213e0109262
3
+ metadata.gz: 5e78f757829191018747a87be6b1c6aec0a8a140b248fab6e698b217d0125575
4
+ data.tar.gz: b3e5cce589f88d49820f06681c72c833f727c2743650e7da0a84cb9fffe40eed
5
5
  SHA512:
6
- metadata.gz: e6f50b3cd6d20bc348c0cf6c94c3e920a54e26c5b1ba2019209b2521febdffcc4fdf9a3bf39d688990a0e3907fbbf244d3ed53e3ecbe53db283ea3aec7342dbf
7
- data.tar.gz: 1849fab8452c635004419e67e8748428e142875aa0c4b4920d4daecab66ed1a2b6ca863124704ae4d847e5c4fce5d38ec8911cb95cc5aad0f533682bc869bc65
6
+ metadata.gz: fa009cab807affa711ec0ac7c4618137401fa56e91651103947c444f835970e61c9a2855316bc0b46c3a669eb84b1f08ae0b211cfdac8f870f910dc203455830
7
+ data.tar.gz: d2f0a68185ebc1b788e5bb90509ab37240599b288d65ef26bc23b900545bc4766eb159757aa2b7ac441d99af5578da339ca1dfe9876ae11904f298443bdaa4c6
@@ -15,6 +15,8 @@ module BulkInsert
15
15
  "#{column.name}=EXCLUDED.#{column.name}"
16
16
  end.join(', ')
17
17
  ' ON CONFLICT(' + update_duplicates.join(', ') + ') DO UPDATE SET ' + update_values
18
+ else
19
+ ''
18
20
  end
19
21
  end
20
22
 
@@ -1,7 +1,7 @@
1
1
  module BulkInsert
2
2
  MAJOR = 1
3
3
  MINOR = 8
4
- TINY = 0
4
+ TINY = 1
5
5
 
6
6
  VERSION = [MAJOR, MINOR, TINY].join(".")
7
7
  end
@@ -353,6 +353,26 @@ class BulkInsertWorkerTest < ActiveSupport::TestCase
353
353
  end
354
354
  end
355
355
 
356
+ test "adapter dependent postgresql methods (no ignore, no update_duplicates)" do
357
+ connection = Testing.connection
358
+ connection.stub :adapter_name, 'PostgreSQL' do
359
+ pgsql_worker = BulkInsert::Worker.new(
360
+ connection,
361
+ Testing.table_name,
362
+ 'id',
363
+ %w(greeting age happy created_at updated_at color),
364
+ 500, # batch size
365
+ false, # ignore
366
+ false, # update duplicates
367
+ true # return primary keys
368
+ )
369
+
370
+ pgsql_worker.add ["Yo", 15, false, nil, nil]
371
+
372
+ assert_equal pgsql_worker.compose_insert_query, "INSERT INTO \"testings\" (\"greeting\",\"age\",\"happy\",\"created_at\",\"updated_at\",\"color\") VALUES ('Yo',15,0,NULL,NULL,'chartreuse') RETURNING id"
373
+ end
374
+ end
375
+
356
376
  test "adapter dependent postgresql methods (with update_duplicates)" do
357
377
  connection = Testing.connection
358
378
  connection.stub :adapter_name, 'PostgreSQL' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bulk_insert
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.0
4
+ version: 1.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jamis Buck
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-05-19 00:00:00.000000000 Z
12
+ date: 2020-05-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord