multiwoven-integrations 0.31.2 → 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: 3d4ab3e1e7f8cc3237943176323a9dc3b7f5bb7783dda9a712d6e4f90b009d5c
4
- data.tar.gz: 1ca74881258ef5c71e265298f3af9e557829b3614c9ebab109183564d4d4db11
3
+ metadata.gz: a19846ac0ce6d79fe650f82a063f03c66ff270665fb77b5f5a597065aadd6fb7
4
+ data.tar.gz: c6860791a09b3fc7233dedbd2a2538bf60f43d9a67b13aecf495f90e566af228
5
5
  SHA512:
6
- metadata.gz: 69a506a64d4ddccbe2792dc819132427e37243926e69e56fb3d1b1dca9a1bab3664666fd3dfbe9c2b5374c0bc9c8c31eb163f58e0e5ccf383ff153b8a8584481
7
- data.tar.gz: acecd84a3e20931608c312160e0de8510a6b6e51dd82e9f670d1d36f1a568429ba0b3ccdc2158656f76fc8ab4f4f19e629e928770d2b90b5bc0b5aa3dd0f554f
6
+ metadata.gz: 91c285a6628ea13206d2bb89b164eea2e4c8bba3932d6cf18ab227151057f6fc8171da6a0f48ae058b427e9e674bad867cfb1f781ffa2fdc4ebb7f44e3eb4eda
7
+ data.tar.gz: df2bd9532ec76b40a9a178ccc83377b4a3ba11655e7a25e039813d1ae83a374015951dab2bf8731f8b3cfa98682db6c5638b41a7ea95295595cf8dc969045895
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Multiwoven
4
4
  module Integrations
5
- VERSION = "0.31.2"
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.2
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-11 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