multiwoven-integrations 0.31.1 → 0.31.3

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: 6e4488183b69dfe716d32c5a708f11327714fd9468f1a6ff60da7380ea3941af
4
- data.tar.gz: 448c7dd7b3ef433378b79fbd1c252c527cd221e2a2388336b9c584cb449bd1ad
3
+ metadata.gz: a19846ac0ce6d79fe650f82a063f03c66ff270665fb77b5f5a597065aadd6fb7
4
+ data.tar.gz: c6860791a09b3fc7233dedbd2a2538bf60f43d9a67b13aecf495f90e566af228
5
5
  SHA512:
6
- metadata.gz: 5c0168ad313208fee89993037c2b49f09d784560cb35a9526512ff47e52809c928492def4f69cf96554d671befd6b3f6a54a7c811c3e81f63e3c42d10452298d
7
- data.tar.gz: bceece8420ae4bed069a8207af2cb21ba009353fbabd760d555a62d3a8e5249991e0dce65fa394414a5ece56d991a47cc28274b81ec30fc4a87a939fbb1fc11c
6
+ metadata.gz: 91c285a6628ea13206d2bb89b164eea2e4c8bba3932d6cf18ab227151057f6fc8171da6a0f48ae058b427e9e674bad867cfb1f781ffa2fdc4ebb7f44e3eb4eda
7
+ data.tar.gz: df2bd9532ec76b40a9a178ccc83377b4a3ba11655e7a25e039813d1ae83a374015951dab2bf8731f8b3cfa98682db6c5638b41a7ea95295595cf8dc969045895
@@ -20,7 +20,10 @@ module Multiwoven::Integrations::Destination
20
20
 
21
21
  def discover(connection_config)
22
22
  connection_config = connection_config.with_indifferent_access
23
- query = "SELECT table_name, column_name, data_type, is_nullable
23
+ query = "SELECT table_name, column_name,
24
+ CASE WHEN data_type = 'USER-DEFINED' THEN udt_name ELSE data_type END
25
+ AS data_type,
26
+ is_nullable
24
27
  FROM information_schema.columns
25
28
  WHERE table_schema = '#{connection_config[:schema]}' AND table_catalog = '#{connection_config[:database]}'
26
29
  ORDER BY table_name, ordinal_position;"
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Multiwoven
4
4
  module Integrations
5
- VERSION = "0.31.1"
5
+ VERSION = "0.31.3"
6
6
 
7
7
  ENABLED_SOURCES = %w[
8
8
  Snowflake
@@ -32,6 +32,7 @@ module Multiwoven::Integrations::Source
32
32
  connection_config = sync_config.source.connection_specification.with_indifferent_access
33
33
  create_connection(connection_config)
34
34
  query = sync_config.model.query
35
+ query = batched_query(query, sync_config.limit, sync_config.offset) unless sync_config.limit.nil? && sync_config.offset.nil?
35
36
  query(connection_config, query)
36
37
  rescue StandardError => e
37
38
  handle_exception(e, {
@@ -79,9 +80,14 @@ module Multiwoven::Integrations::Source
79
80
 
80
81
  def query(connection, query)
81
82
  limit = 0
83
+ offset = 0
84
+ order = "id DESC"
85
+
82
86
  limit = query.match(/LIMIT (\d+)/)[1].to_i if query.include? "LIMIT"
87
+ offset = query.match(/OFFSET (\d+)/)[1].to_i if query.include? "OFFSET"
88
+ order = query.match(/ORDER BY (.*) LIMIT/)[1] if query.include? "ORDER BY"
89
+ model = query.match(/FROM ([aA-zZ.aA-zZ]*)/i)[1]
83
90
 
84
- model = query.gsub(/LIMIT\s+\d+/i, "").gsub(/SELECT (.*) FROM/, "").strip
85
91
  columns = if query.include? "SELECT *"
86
92
  []
87
93
  else
@@ -89,9 +95,9 @@ module Multiwoven::Integrations::Source
89
95
  end
90
96
 
91
97
  records = @client.execute_kw(connection[:database], @uid, connection[:password],
92
- model, "search_read", [], { limit: limit, 'fields': columns })
98
+ model, "search_read", [], { limit: limit,
99
+ offset: offset, order: order, 'fields': columns })
93
100
  records.map do |row|
94
- puts row
95
101
  RecordMessage.new(data: row, emitted_at: Time.now.to_i).to_multiwoven_message
96
102
  end
97
103
  end
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.31.1
4
+ version: 0.31.3
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: 2025-07-10 00:00:00.000000000 Z
11
+ date: 2025-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport