uc3-dmp-dynamo 0.0.25 → 0.0.26

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 952025eaebd77656ae42684db7c21573b38941800f2ce2a668a0a547dd68576a
4
- data.tar.gz: 8d0a4ed111e36ebc3f2ef030d14c1d6f4be1b019136a856acbd23d67774c1454
3
+ metadata.gz: bbf456be46d758f19b606a34ac44da34a12fcd85196136f87e0e5e61163ba8d6
4
+ data.tar.gz: 95347f6c9a31d8ec2f6501c640daefd5e30f36ece1b3c11cbc1415007d1d8a7b
5
5
  SHA512:
6
- metadata.gz: 5126da343b4d48fa39f18ac149d38b9108ad00ce60b535928e2fa6d58b660503fddcb2dc8eeb187dbd0ae4be78dd00cec4bcce0246e84b7ab7dd44191f457135
7
- data.tar.gz: ed8f087a66825b3d192d8fa8e8cde2c9a57a1f6466d330352f982d3c20f5089d3c9cc24c2f1288c44c06067159e933e1c28c5c4346d31d0d2cf02341d91f49a3
6
+ metadata.gz: 484361366b042853264549e519763d0583b1307fc188d5c976365b0d1ebe92c643ad3556b3f8af5f40814358ec502a5dd1441505aa56f303f29c54ceacd56b19
7
+ data.tar.gz: 4f3d3d36d83f415454a8be41d3869b9612e4410a39253ac0482bcadaf573231baf89b9bdbd218daff4d43409f8cd50d706f869a5a29c4c7bb92cf075f77e1895
@@ -55,14 +55,21 @@ module Uc3DmpDynamo
55
55
  # See the DynamoDB docs for examples of key_conditions and projection_expressions
56
56
  # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
57
57
  def query(args:, logger: nil)
58
- raise ClientError, MSG_INVALID_KEY unless args.is_a?(Hash) && args.fetch(:key_conditions, {}).any?
58
+ raise ClientError, MSG_INVALID_KEY unless args.is_a?(Hash) &&
59
+ (args.fetch(:key_conditions, {}).any? ||
60
+ args.fetch(:key_condition_expression, {}).any?)
59
61
 
60
62
  hash = {
61
63
  table_name: @table,
62
- key_conditions: args[:key_conditions],
63
64
  consistent_read: false,
64
65
  return_consumed_capacity: logger&.level == 'debug' ? 'TOTAL' : 'NONE'
65
66
  }
67
+ if args.fetch(:key_condition_expression, {}).any?
68
+ hash[:key_condition_expression] = args[:key_condition_expression]
69
+ else
70
+ hash[:key_conditions] = args[:key_conditions]
71
+ end
72
+
66
73
  # Look for and add any other filtering or projection args
67
74
  %i[index_name filter_expression expression_attribute_values projection_expression
68
75
  scan_index_forward].each do |key|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpDynamo
4
- VERSION = '0.0.25'
4
+ VERSION = '0.0.26'
5
5
  end
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.25
4
+ version: 0.0.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Riley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-10 00:00:00.000000000 Z
11
+ date: 2025-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json