multiwoven-integrations 0.35.1 → 0.35.2

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: efeae4ad1a6fd1be0c8530549eb79170538a9dd85755a8b2ff34fed5bf317b28
4
- data.tar.gz: 35facc7d8dbc2c70dcc4f9c9ea2c0d501a286673c1a81a084304538b6455b29a
3
+ metadata.gz: 2c6bf44e44a29c0ee851e748acf3ce7adf10495e413caaa6a5fa233155841abf
4
+ data.tar.gz: 50c9d53c1010c4656010e29a708b38be7c990ea81395ef85d3519998de68d03a
5
5
  SHA512:
6
- metadata.gz: 5d7f34c3603386e2a9472aca3ded645b24c2764080cf7b41d98f0e80f619004aa5f14b8fad44a5f961498eedf1ce9ae82ca09f1adb21a167213ce6bbc2c77859
7
- data.tar.gz: 07c89f2f17ec8f7f2858025c7dbc23cb44c2971e3c10f3daac974963e5807570c3d7b0d21f52d6ddb8cf8de21e909e18442516e6222c6f36f726eda9c762e426
6
+ metadata.gz: 4fb43e2a451ab824e9318fb94878eb2059f7cb0756ced03d37371b35b7c7ab0699574dba9b6ede033321e4082a295169ac074f94463e32ed4ed32e1123f8b856
7
+ data.tar.gz: 5c4c85224e29eec00ccf32c0be81ecc1cb97c2f58d06b33b3220c0ab79a7ccbd78e2eea8ad102fa7d67879873e1c1ff218932aba37ab08b2e72fd1bef6b0c21b
@@ -106,15 +106,19 @@ module Multiwoven::Integrations::Destination
106
106
  end
107
107
 
108
108
  sql = "INSERT INTO #{table_name} (#{col_list}) VALUES #{values_clauses.join(", ")}"
109
- sql += build_upsert_clause(columns, primary_key) if action.to_s == "destination_update"
109
+ if primary_key.present?
110
+ sql += action.to_s == "destination_insert" ? build_safe_insert_clause(primary_key) : build_upsert_clause(columns, primary_key)
111
+ end
110
112
  db.exec(sql)
111
113
  end
112
114
 
113
- def build_upsert_clause(columns, primary_key)
114
- return "" unless primary_key.present?
115
+ def build_safe_insert_clause(primary_key)
116
+ " ON CONFLICT (#{quote_ident(primary_key)}) DO NOTHING"
117
+ end
115
118
 
119
+ def build_upsert_clause(columns, primary_key)
116
120
  update_cols = columns.reject { |c| c.to_s == primary_key.to_s }
117
- return " ON CONFLICT (#{quote_ident(primary_key)}) DO NOTHING" if update_cols.empty?
121
+ return build_safe_insert_clause(primary_key) if update_cols.empty?
118
122
 
119
123
  set_clause = update_cols.map { |c| "#{quote_ident(c)} = EXCLUDED.#{quote_ident(c)}" }.join(", ")
120
124
  " ON CONFLICT (#{quote_ident(primary_key)}) DO UPDATE SET #{set_clause}"
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Multiwoven
4
4
  module Integrations
5
- VERSION = "0.35.1"
5
+ VERSION = "0.35.2"
6
6
 
7
7
  ENABLED_SOURCES = %w[
8
8
  Snowflake
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: multiwoven-integrations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.35.1
4
+ version: 0.35.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Subin T P
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-03-19 00:00:00.000000000 Z
11
+ date: 2026-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport