em-pg-client-helper 2.0.5 → 2.0.6
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 +4 -4
- data/lib/em-pg-client-helper/transaction.rb +2 -1
- data/spec/db_bulk_insert_spec.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 54a166e4a003830acb87084c9ce7e3e89247adc0
|
|
4
|
+
data.tar.gz: 6fd87c473b76cb510cbee6d46e5c161c08c1b783
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 542c67c1cc93d7bcdd2c871edfd553ced9aa2de42906822b31931662344521c6a7e6697f56d7c70aa3fc84431410991ac08f9b0d135c6d0fdf97ef85193b8c58
|
|
7
|
+
data.tar.gz: 15c39dd9ba382f9ee0a267e2406f63c6171fb4438a5b205128406a3203facd2e9197066d79b26a9fe0a002c63df8b87dd0404f020b27006e34d5a5ad9acf979c
|
|
@@ -284,7 +284,8 @@ class PG::EM::Client::Helper::Transaction
|
|
|
284
284
|
"(" + row.map { |v| usdb.literal(v) }.join(", ") + ")"
|
|
285
285
|
end.join(", ")
|
|
286
286
|
|
|
287
|
-
"INSERT INTO #{q_tbl} (
|
|
287
|
+
"INSERT INTO #{q_tbl} (#{q_cols.join(", ")}) " +
|
|
288
|
+
"(SELECT * FROM (VALUES #{vals}) " +
|
|
288
289
|
"AS src (#{q_cols.join(", ")}) WHERE NOT EXISTS (#{subselect}))"
|
|
289
290
|
end
|
|
290
291
|
end
|
data/spec/db_bulk_insert_spec.rb
CHANGED
|
@@ -3,7 +3,7 @@ require_relative './spec_helper'
|
|
|
3
3
|
describe "PG::EM::Client::Helper#db_bulk_insert" do
|
|
4
4
|
let(:mock_conn) { double(PG::EM::Client) }
|
|
5
5
|
let(:fast_query) do
|
|
6
|
-
'INSERT INTO "foo" ' +
|
|
6
|
+
'INSERT INTO "foo" ("bar", "baz") ' +
|
|
7
7
|
'(SELECT * FROM (VALUES (1, \'x\'), (3, \'y\')) ' +
|
|
8
8
|
'AS src ("bar", "baz") ' +
|
|
9
9
|
'WHERE NOT EXISTS ' +
|