dynamodb-api 0.3.1 → 0.3.2
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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/dynamodb/api/query.rb +1 -10
- data/lib/dynamodb/api/relation/query_methods.rb +2 -2
- data/lib/dynamodb/api/relation/where_clause.rb +18 -7
- data/lib/dynamodb/api/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: e26469278271c2105d8178a710e44188444669bc5b0e5836d8841563af38f5e5
|
4
|
+
data.tar.gz: b93ba92f5c00e7c7062cea8b8b9c014a80fcd22a7f8ad687d47b0d04737676c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15b00f5440b621d9f515c207ce2beef65ab094c94e2504dfdf32392a23476cba273734908da29a2202e55d9abdb16059c3a7152dc117c13e2550b629408bb5eb
|
7
|
+
data.tar.gz: 5a9fef74495cf50628c0c4e4ed69016246272fec57b243c99d610bb109db4ac4b650a9d77b95631c55159fbaba8abd864387f65776f4442cd2df2cc8cedebd4c
|
data/Gemfile.lock
CHANGED
data/lib/dynamodb/api/query.rb
CHANGED
@@ -23,19 +23,10 @@ module Dynamodb
|
|
23
23
|
index_name: @relation.index_clause.name,
|
24
24
|
select: @relation.select_clause.name,
|
25
25
|
scan_index_forward: @relation.order_clause.direct,
|
26
|
-
key_conditions:
|
26
|
+
key_conditions: @relation.where_clause.key_conditions
|
27
27
|
}.merge(build_filter_clause)
|
28
28
|
end
|
29
29
|
|
30
|
-
def build_where_clause
|
31
|
-
{
|
32
|
-
@relation.where_clause.key => {
|
33
|
-
attribute_value_list: [@relation.where_clause.value],
|
34
|
-
comparison_operator: @relation.where_clause.operator
|
35
|
-
}
|
36
|
-
}
|
37
|
-
end
|
38
|
-
|
39
30
|
def build_filter_clause
|
40
31
|
{
|
41
32
|
filter_expression: @relation.filter_clause.expression,
|
@@ -4,14 +4,25 @@ module Dynamodb
|
|
4
4
|
module Api
|
5
5
|
class Relation
|
6
6
|
class WhereClause # :nodoc:
|
7
|
-
attr_reader :
|
8
|
-
attr_reader :value
|
9
|
-
attr_reader :operator
|
7
|
+
attr_reader :key_conditions
|
10
8
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
9
|
+
KEY = 0
|
10
|
+
VALUE = 1
|
11
|
+
OPERATOR = 2
|
12
|
+
|
13
|
+
def initialize(key_conditions)
|
14
|
+
@key_conditions = build(key_conditions)
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def build(key_conditions)
|
20
|
+
key_conditions.each_with_object({}) do |c, h|
|
21
|
+
h[c[KEY]] = {
|
22
|
+
attribute_value_list: c[VALUE],
|
23
|
+
comparison_operator: c[OPERATOR]
|
24
|
+
}
|
25
|
+
end
|
15
26
|
end
|
16
27
|
end
|
17
28
|
end
|
data/lib/dynamodb/api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dynamodb-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- WalkerSumida
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-07-
|
11
|
+
date: 2018-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|