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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a19de38297f2abf4e165739a67763a989892daca
4
- data.tar.gz: 3fd81be8b4ffa49b8b2c2df4f25d15d7f2b4b5da
3
+ metadata.gz: 381579a661267424c29a8423652dc13617259094
4
+ data.tar.gz: 48bda508abe0058038164e9a0915851dabcf8796
5
5
  SHA512:
6
- metadata.gz: ed60ac6ce628a15294b08558398fd4a5305a7608d2a1a6397b5873c0eb455fc7085d7a4821fc5ee0f845fb9cb7d9a260ed486ee0a70390425e0d9730c4f884dc
7
- data.tar.gz: f926c1169e267f288a6d87b6b8b06287502229eb861674a376884e2a88d603c4872440d5b07b21c900e3a6d830f5b1fae9d3ed7ff6966c9c7aede4c8078435e3
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
@@ -1,3 +1,3 @@
1
1
  module Dynamosaurus
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
@@ -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.3
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-08-26 00:00:00.000000000 Z
11
+ date: 2016-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler