dynamosaurus 0.1.3 → 0.1.4
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/lib/dynamosaurus/dynamo_class.rb +8 -1
- data/lib/dynamosaurus/version.rb +1 -1
- data/spec/testmodel.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 381579a661267424c29a8423652dc13617259094
|
|
4
|
+
data.tar.gz: 48bda508abe0058038164e9a0915851dabcf8796
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0957b8f2bb4ed41b944ac3ba50f894007f44298a2592609f02c42912bc561f011824ec47d78a2e35e226758dcd3b29b0e2028219cc46022f55cfd4626b661624
|
|
7
|
+
data.tar.gz: 4ff3db1a018b7f1bd26417655c5d488e4b134c8642566ed355b539af7b3f1184acb30c1416ae166b3432025896ccc62a1a0c1c8e6b90e7a567ab0a52547f61ca
|
|
@@ -108,13 +108,15 @@ module Dynamosaurus
|
|
|
108
108
|
end
|
|
109
109
|
|
|
110
110
|
def local_secondary_schemas
|
|
111
|
+
@secondary_index_option = {} if @secondary_index_option.nil?
|
|
111
112
|
schema = []
|
|
112
113
|
get_secondary_indexes.each do |index_key, index_value|
|
|
114
|
+
option = @secondary_index_option[index_key] || {}
|
|
113
115
|
schema << {
|
|
114
116
|
index_name: index_key,
|
|
115
117
|
key_schema: [],
|
|
116
118
|
projection: {
|
|
117
|
-
projection_type: "KEYS_ONLY",
|
|
119
|
+
:projection_type => (option[:projection_type] || "KEYS_ONLY"),
|
|
118
120
|
},
|
|
119
121
|
key_schema: [
|
|
120
122
|
{
|
|
@@ -228,6 +230,11 @@ module Dynamosaurus
|
|
|
228
230
|
@secondary_index[index_name.to_sym] = [@key[0], @key[1], range_key_name, Dynamosaurus::DynamoBase::TYPES[range_key_type]] if range_key_name
|
|
229
231
|
end
|
|
230
232
|
|
|
233
|
+
def secondary_index_option index_name, option
|
|
234
|
+
@secondary_index_option = {} if @secondary_index_option.nil?
|
|
235
|
+
@secondary_index_option[index_name] = option
|
|
236
|
+
end
|
|
237
|
+
|
|
231
238
|
def get_secondary_indexes
|
|
232
239
|
@secondary_index ? @secondary_index : {}
|
|
233
240
|
end
|
data/lib/dynamosaurus/version.rb
CHANGED
data/spec/testmodel.rb
CHANGED
|
@@ -33,5 +33,6 @@ class Follow < Dynamosaurus::DynamoBase
|
|
|
33
33
|
key :user_id, :string, :from_user_id, :string
|
|
34
34
|
|
|
35
35
|
secondary_index :updated_at_index, :updated_at, :number
|
|
36
|
+
secondary_index_option :updated_at_index, {projection_type: "ALL"}
|
|
36
37
|
global_index :from_user_index, :from_user_id, :string, :updated_at, :number
|
|
37
38
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dynamosaurus
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Isamu Arimoto
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-
|
|
11
|
+
date: 2016-09-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|