multiwoven-integrations 0.7.1 → 0.7.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 693440a73b76750eaccde5f6f31740a7545330d279bc429c837f9f7fb818f8bc
|
4
|
+
data.tar.gz: 6ad84800b7397a69c2b4db6698044379b0514840776a893ebbe996e62b8b7f4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d57f467335ccd3685a58c13662e741c87408d11ca1043258d63e2ee76ee69794491e43fce2b42bd2ba15947974aa8ac40a2c734db51efe2ed328722d8e674b4b
|
7
|
+
data.tar.gz: 5b520ab5ff9f6168ac9cbfa750ee1a1bb02063f84ac7044ed9eb95611b13659b674ae02aece579e30921a3439efb1789a5f98f548ce65e74b030111264ead7e8
|
data/README.md
CHANGED
@@ -59,6 +59,10 @@ Before you begin the installation, ensure you have the following dependencies in
|
|
59
59
|
- Command: `brew install openssl@3`
|
60
60
|
- Description: Essential for secure communication.
|
61
61
|
|
62
|
+
- **Oracle Instant Client**
|
63
|
+
- Download Link: https://www.oracle.com/database/technologies/instant-client/downloads.html
|
64
|
+
- Description: Required for database interactions.
|
65
|
+
|
62
66
|
|
63
67
|
### Installation
|
64
68
|
|
@@ -153,13 +153,15 @@ module Multiwoven
|
|
153
153
|
|
154
154
|
# Batch has a limit of sending 2MB data. So creating a chunk of records to meet that limit
|
155
155
|
def process_record_chunks(records, sync_config)
|
156
|
+
log_message_array = []
|
156
157
|
write_success = 0
|
157
158
|
write_failure = 0
|
158
159
|
|
159
160
|
records.each_slice(MAX_CHUNK_SIZE) do |chunk|
|
160
161
|
values = prepare_chunk_values(chunk, sync_config.stream)
|
161
|
-
update_sheet_values(values, sync_config.stream.name)
|
162
|
+
request, response = *update_sheet_values(values, sync_config.stream.name)
|
162
163
|
write_success += values.size
|
164
|
+
log_message_array << log_request_response("info", request, response)
|
163
165
|
rescue StandardError => e
|
164
166
|
handle_exception(e, {
|
165
167
|
context: "GOOGLE_SHEETS:RECORD:WRITE:EXCEPTION",
|
@@ -168,9 +170,9 @@ module Multiwoven
|
|
168
170
|
sync_run_id: sync_config.sync_run_id
|
169
171
|
})
|
170
172
|
write_failure += chunk.size
|
173
|
+
log_message_array << log_request_response("error", request, e.message)
|
171
174
|
end
|
172
|
-
|
173
|
-
tracking_message(write_success, write_failure)
|
175
|
+
tracking_message(write_success, write_failure, log_message_array)
|
174
176
|
end
|
175
177
|
|
176
178
|
# We need to format the data to adhere to google sheets API format. This converts the sync mapped data to 2D array format expected by google sheets API
|
@@ -199,19 +201,14 @@ module Multiwoven
|
|
199
201
|
)
|
200
202
|
|
201
203
|
# TODO: Remove & this is added for the test to pass we need
|
202
|
-
@client&.batch_update_values(@spreadsheet_id, batch_update_request)
|
204
|
+
response = @client&.batch_update_values(@spreadsheet_id, batch_update_request)
|
205
|
+
[batch_update_request, response]
|
203
206
|
end
|
204
207
|
|
205
208
|
def load_catalog
|
206
209
|
read_json(CATALOG_SPEC_PATH)
|
207
210
|
end
|
208
211
|
|
209
|
-
def tracking_message(success, failure)
|
210
|
-
Multiwoven::Integrations::Protocol::TrackingMessage.new(
|
211
|
-
success: success, failed: failure
|
212
|
-
).to_multiwoven_message
|
213
|
-
end
|
214
|
-
|
215
212
|
def delete_extra_sheets(sheet_ids)
|
216
213
|
# Leave one sheet intact as a spreadsheet must have at least one sheet.
|
217
214
|
# Delete all other sheets.
|
@@ -41,6 +41,7 @@ module Multiwoven::Integrations::Destination
|
|
41
41
|
primary_key = sync_config.model.primary_key
|
42
42
|
db = create_connection(connection_config)
|
43
43
|
|
44
|
+
log_message_array = []
|
44
45
|
write_success = 0
|
45
46
|
write_failure = 0
|
46
47
|
|
@@ -50,6 +51,7 @@ module Multiwoven::Integrations::Destination
|
|
50
51
|
begin
|
51
52
|
db.run(query)
|
52
53
|
write_success += 1
|
54
|
+
log_message_array << log_request_response("info", query, "Successful")
|
53
55
|
rescue StandardError => e
|
54
56
|
handle_exception(e, {
|
55
57
|
context: "MARIA:DB:RECORD:WRITE:EXCEPTION",
|
@@ -58,9 +60,10 @@ module Multiwoven::Integrations::Destination
|
|
58
60
|
sync_run_id: sync_config.sync_run_id
|
59
61
|
})
|
60
62
|
write_failure += 1
|
63
|
+
log_message_array << log_request_response("error", query, e.message)
|
61
64
|
end
|
62
65
|
end
|
63
|
-
tracking_message(write_success, write_failure)
|
66
|
+
tracking_message(write_success, write_failure, log_message_array)
|
64
67
|
rescue StandardError => e
|
65
68
|
handle_exception(e, {
|
66
69
|
context: "MARIA:DB:RECORD:WRITE:EXCEPTION",
|
@@ -106,12 +109,6 @@ module Multiwoven::Integrations::Destination
|
|
106
109
|
{ tablename: entries.first[:tablename], columns: entries.flat_map { |entry| entry[:columns] } }
|
107
110
|
end
|
108
111
|
end
|
109
|
-
|
110
|
-
def tracking_message(success, failure)
|
111
|
-
Multiwoven::Integrations::Protocol::TrackingMessage.new(
|
112
|
-
success: success, failed: failure
|
113
|
-
).to_multiwoven_message
|
114
|
-
end
|
115
112
|
end
|
116
113
|
end
|
117
114
|
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.7.
|
4
|
+
version: 0.7.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: 2024-08-
|
11
|
+
date: 2024-08-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|