uc3-dmp-dynamo 0.0.19 → 0.0.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/uc3-dmp-dynamo/client.rb +25 -0
- data/lib/uc3-dmp-dynamo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 772a7143667cc896819cd1aaa74e163b9c3822ad39924e35df53abac63f8134a
|
4
|
+
data.tar.gz: 1239375f6bb03b369fc4d8d2b39e4e5b21b351cc5dd9ffe63904ab18e460f7d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2cddf628245cdb3e38ce62615a702bee8fe6efd4ee95e1bf7ca0bb72c2f8e262063eaa62b8473626cd2d2425cba524879fab49ffdd68228e18df5948e3f4dab
|
7
|
+
data.tar.gz: 3f49213a7b16a17d6d83e413b305a8a32f7158c262320d4942bdc2282b4be2bb2a35a40e5669289f7891d47b8c1be0fed512d0a86900be1d3f6017f18739e7f5
|
@@ -82,6 +82,31 @@ module Uc3DmpDynamo
|
|
82
82
|
end
|
83
83
|
# rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
84
84
|
|
85
|
+
# rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
86
|
+
def scan(args:, logger: nil)
|
87
|
+
hash = {
|
88
|
+
table_name: @table,
|
89
|
+
consistent_read: false,
|
90
|
+
return_consumed_capacity: logger&.level == 'debug' ? 'TOTAL' : 'NONE'
|
91
|
+
}
|
92
|
+
# Look for and add any other filtering or projection args
|
93
|
+
%i[filter_expression expression_attribute_values projection_expression expression_attribute_names].each do |key|
|
94
|
+
next if args[key.to_sym].nil?
|
95
|
+
|
96
|
+
hash[key.to_sym] = args[key.to_sym]
|
97
|
+
end
|
98
|
+
|
99
|
+
logger.debug(message: "#{SOURCE} queried for: #{hash}") if logger.respond_to?(:debug)
|
100
|
+
resp = @connection.scan(hash)
|
101
|
+
return [] unless resp.items.any?
|
102
|
+
return resp.items if resp.items.first.is_a?(Hash)
|
103
|
+
|
104
|
+
resp.items.first.respond_to?(:item) ? resp.items.map(&:item) : resp.items
|
105
|
+
rescue Aws::Errors::ServiceError => e
|
106
|
+
raise ClientError, format(MSG_DYNAMO_ERROR, msg: e.message, trace: e.backtrace)
|
107
|
+
end
|
108
|
+
# rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
109
|
+
|
85
110
|
# Create/Update an item
|
86
111
|
# rubocop:disable Metrics/AbcSize
|
87
112
|
def put_item(json:, logger: nil)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uc3-dmp-dynamo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Riley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-10-
|
11
|
+
date: 2023-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|