composite_primary_keys 12.0.4 → 12.0.5
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2a0ca9aa38fb1dfdca5c0974049eec9faf2c5703666a8e8de2ad28f6c78c7bc
|
4
|
+
data.tar.gz: 6384ddd8291fbd65e074965bfb70b8945c4ac6b556537973cc62561a86a0c609
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c8a87f9676da79d514cd3dd2b21d7c1b523ddde1e13a2b37484e69ed4d93556e94fd725bc41642117338de66679932b69aff077c90c6c45d2026792439f4d5a
|
7
|
+
data.tar.gz: 5e393c7b725a757bef1a5b99efb9ef62612e3d11b7aa8dec15399684221a6a75f1b34908434b1471a0bc86a67814e7e387905d6e92885f7dddefb521668a7f9b
|
data/History.rdoc
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
== 12.0.5 (2020-12-31)
|
2
|
+
* Finally issue with SQLServer when tables are marked as exclude_output_inserted. See #535. (Charlie Savage)
|
3
|
+
|
1
4
|
== 12.0.4 (2020-12-30)
|
2
5
|
* Fix compatibility with Ruby Ruby 2.6 and below (ta1kt0me)
|
3
6
|
* Finally get SQLServer mass updates and deletes working (Charlie Savage)
|
@@ -15,15 +15,18 @@ module ActiveRecord
|
|
15
15
|
|
16
16
|
table_name ||= get_table_name(sql)
|
17
17
|
exclude_output_inserted = exclude_output_inserted_table_name?(table_name, sql)
|
18
|
-
|
19
18
|
if exclude_output_inserted
|
20
19
|
id_sql_type = exclude_output_inserted.is_a?(TrueClass) ? "bigint" : exclude_output_inserted
|
20
|
+
# CPK
|
21
|
+
# <<~SQL.squish
|
22
|
+
# DECLARE @ssaIdInsertTable table (#{quoted_pk} #{id_sql_type});
|
23
|
+
# #{sql.dup.insert sql.index(/ (DEFAULT )?VALUES/), " OUTPUT INSERTED.#{quoted_pk} INTO @ssaIdInsertTable"}
|
24
|
+
# SELECT CAST(#{quoted_pk.join(',')} AS #{id_sql_type}) FROM @ssaIdInsertTable
|
25
|
+
# SQL
|
21
26
|
<<~SQL.squish
|
22
|
-
DECLARE @ssaIdInsertTable table (#{quoted_pk} #{id_sql_type});
|
23
|
-
# CPK
|
24
|
-
# #{sql.dup.insert sql.index(/ (DEFAULT )?VALUES/), " OUTPUT INSERTED.#{quoted_pk} INTO @ssaIdInsertTable"}
|
27
|
+
DECLARE @ssaIdInsertTable table (#{quoted_pk.map {|subkey| "#{subkey} #{id_sql_type}"}.join(", ")});
|
25
28
|
#{sql.dup.insert sql.index(/ (DEFAULT )?VALUES/), " OUTPUT INSERTED.#{quoted_pk.join(', INSERTED.')} INTO @ssaIdInsertTable"}
|
26
|
-
SELECT
|
29
|
+
SELECT #{quoted_pk.map {|subkey| "CAST(#{subkey} AS #{id_sql_type}) #{subkey}"}.join(", ")} FROM @ssaIdInsertTable
|
27
30
|
SQL
|
28
31
|
else
|
29
32
|
# CPK
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: composite_primary_keys
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 12.0.
|
4
|
+
version: 12.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Charlie Savage
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-12-
|
11
|
+
date: 2020-12-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|