dynamosaurus 0.1.2 → 0.1.3

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: dffeb0c97ef0cf78f95d3a06eff20588f729f991
4
- data.tar.gz: 6d65b3fe671f3e4ca557007c53a824a1de781588
3
+ metadata.gz: a19de38297f2abf4e165739a67763a989892daca
4
+ data.tar.gz: 3fd81be8b4ffa49b8b2c2df4f25d15d7f2b4b5da
5
5
  SHA512:
6
- metadata.gz: 03ad78f75118936ca0714c1a603d640dcf11ad2a3f697366f7261b48c3bd4c4b1a531cad382263cc1e90752c3a1f11346bd86680a403ae111583209f7c23c57d
7
- data.tar.gz: 742c27573fd879f3bbafc35163cb2f3589add926f89be10e39fda5fc246eb3bf23b00c1b72ae209d95566a0acdd73d7c6b226c20e8d0db93bad61d5a63895710
6
+ metadata.gz: ed60ac6ce628a15294b08558398fd4a5305a7608d2a1a6397b5873c0eb455fc7085d7a4821fc5ee0f845fb9cb7d9a260ed486ee0a70390425e0d9730c4f884dc
7
+ data.tar.gz: f926c1169e267f288a6d87b6b8b06287502229eb861674a376884e2a88d603c4872440d5b07b21c900e3a6d830f5b1fae9d3ed7ff6966c9c7aede4c8078435e3
@@ -132,13 +132,16 @@ module Dynamosaurus
132
132
  end
133
133
 
134
134
  def global_index_schemas
135
+ @global_index_option = {} if @global_index_option.nil?
135
136
  schema = []
136
137
  get_global_indexes.each do |index|
138
+ option = @global_index_option[index[0]] || {}
139
+
137
140
  schema << {
138
141
  :index_name => index[0],
139
142
  :key_schema => global_index_key_schema(index),
140
143
  :projection => {
141
- :projection_type => "KEYS_ONLY",
144
+ :projection_type => (option[:projection_type] || "KEYS_ONLY"),
142
145
  },
143
146
  :provisioned_throughput => {
144
147
  :read_capacity_units => 10,
@@ -207,6 +210,11 @@ module Dynamosaurus
207
210
  @global_index[index_name] << range_key_name << Dynamosaurus::DynamoBase::TYPES[range_key_type] if range_key_name
208
211
  end
209
212
 
213
+ def global_index_option index_name, option
214
+ @global_index_option = {} if @global_index_option.nil?
215
+ @global_index_option[index_name] = option
216
+ end
217
+
210
218
  def get_global_indexes
211
219
  (@global_index) ? @global_index : {}
212
220
 
@@ -1,3 +1,3 @@
1
1
  module Dynamosaurus
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -2,11 +2,11 @@ require 'spec_helper'
2
2
 
3
3
  describe Dynamosaurus::DynamoBase do
4
4
  before(:all) do
5
- ENV['DYNAMODB_SUFFIX'] = "_local2"
5
+ ENV['DYNAMODB_SUFFIX'] = "_local_spec"
6
6
 
7
7
  Aws.config = {
8
8
  :endpoint => "http://localhost:8000",
9
- :region => 'local_test',
9
+ :region => 'local_test_spec',
10
10
  }
11
11
  Dynamosaurus::DynamoBase.create_tables
12
12
  end
@@ -26,6 +26,7 @@ end
26
26
  class Like < Dynamosaurus::DynamoBase
27
27
  key :object_id, :string, :user_id, :string
28
28
  global_index :user_index, :user_id, :string
29
+ global_index_option :user_index, {projection_type: "ALL"}
29
30
  end
30
31
 
31
32
  class Follow < Dynamosaurus::DynamoBase
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.2
4
+ version: 0.1.3
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-05 00:00:00.000000000 Z
11
+ date: 2016-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler