dynamoid 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Dynamoid.gemspec +5 -3
- data/README.markdown +2 -2
- data/VERSION +1 -1
- data/doc/Dynamoid.html +26 -14
- data/doc/Dynamoid/Adapter.html +33 -35
- data/doc/Dynamoid/Adapter/AwsSdk.html +177 -153
- data/doc/Dynamoid/Adapter/Local.html +144 -57
- data/doc/Dynamoid/Associations.html +3 -3
- data/doc/Dynamoid/Associations/Association.html +104 -1016
- data/doc/Dynamoid/Associations/BelongsTo.html +11 -192
- data/doc/Dynamoid/Associations/ClassMethods.html +17 -17
- data/doc/Dynamoid/Associations/HasAndBelongsToMany.html +15 -190
- data/doc/Dynamoid/Associations/HasMany.html +15 -190
- data/doc/Dynamoid/Associations/HasOne.html +11 -192
- data/doc/Dynamoid/Associations/ManyAssociation.html +1640 -0
- data/doc/Dynamoid/Associations/SingleAssociation.html +598 -0
- data/doc/Dynamoid/Components.html +4 -2
- data/doc/Dynamoid/Config.html +10 -10
- data/doc/Dynamoid/Config/Options.html +1 -1
- data/doc/Dynamoid/Criteria.html +1 -1
- data/doc/Dynamoid/Criteria/Chain.html +326 -22
- data/doc/Dynamoid/Criteria/ClassMethods.html +1 -1
- data/doc/Dynamoid/Document.html +181 -27
- data/doc/Dynamoid/Document/ClassMethods.html +392 -36
- data/doc/Dynamoid/Errors.html +1 -1
- data/doc/Dynamoid/Errors/DocumentNotValid.html +1 -1
- data/doc/Dynamoid/Errors/Error.html +1 -1
- data/doc/Dynamoid/Errors/InvalidField.html +1 -1
- data/doc/Dynamoid/Errors/MissingRangeKey.html +1 -1
- data/doc/Dynamoid/Fields.html +44 -24
- data/doc/Dynamoid/Fields/ClassMethods.html +60 -15
- data/doc/Dynamoid/Finders.html +1 -1
- data/doc/Dynamoid/Finders/ClassMethods.html +45 -31
- data/doc/Dynamoid/Indexes.html +7 -7
- data/doc/Dynamoid/Indexes/ClassMethods.html +6 -4
- data/doc/Dynamoid/Indexes/Index.html +47 -32
- data/doc/Dynamoid/Persistence.html +47 -49
- data/doc/Dynamoid/Persistence/ClassMethods.html +149 -47
- data/doc/Dynamoid/Validations.html +1 -1
- data/doc/_index.html +35 -13
- data/doc/class_list.html +1 -1
- data/doc/file.LICENSE.html +1 -1
- data/doc/file.README.html +37 -4
- data/doc/index.html +37 -4
- data/doc/method_list.html +320 -136
- data/doc/top-level-namespace.html +1 -1
- data/lib/dynamoid/adapter.rb +28 -30
- data/lib/dynamoid/adapter/aws_sdk.rb +23 -22
- data/lib/dynamoid/persistence.rb +33 -27
- metadata +6 -4
data/Dynamoid.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "dynamoid"
|
8
|
-
s.version = "0.4.
|
8
|
+
s.version = "0.4.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Josh Symonds"]
|
12
|
-
s.date = "2012-04
|
12
|
+
s.date = "2012-05-04"
|
13
13
|
s.description = "Dynamoid is an ORM for Amazon's DynamoDB that supports offline development, associations, querying, and everything else you'd expect from an ActiveRecord-style replacement."
|
14
14
|
s.email = "josh@joshsymonds.com"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -38,6 +38,8 @@ Gem::Specification.new do |s|
|
|
38
38
|
"doc/Dynamoid/Associations/HasAndBelongsToMany.html",
|
39
39
|
"doc/Dynamoid/Associations/HasMany.html",
|
40
40
|
"doc/Dynamoid/Associations/HasOne.html",
|
41
|
+
"doc/Dynamoid/Associations/ManyAssociation.html",
|
42
|
+
"doc/Dynamoid/Associations/SingleAssociation.html",
|
41
43
|
"doc/Dynamoid/Components.html",
|
42
44
|
"doc/Dynamoid/Config.html",
|
43
45
|
"doc/Dynamoid/Config/Options.html",
|
@@ -133,7 +135,7 @@ Gem::Specification.new do |s|
|
|
133
135
|
s.homepage = "http://github.com/Veraticus/Dynamoid"
|
134
136
|
s.licenses = ["MIT"]
|
135
137
|
s.require_paths = ["lib"]
|
136
|
-
s.rubygems_version = "1.8.
|
138
|
+
s.rubygems_version = "1.8.24"
|
137
139
|
s.summary = "Dynamoid is an ORM for Amazon's DynamoDB"
|
138
140
|
|
139
141
|
if s.respond_to? :specification_version then
|
data/README.markdown
CHANGED
@@ -21,14 +21,14 @@ Then you need to initialize it to get it going. Put code similar to this somewhe
|
|
21
21
|
config.adapter = 'local' # This adapter allows offline development without connecting to the DynamoDB servers. Data is *NOT* persisted.
|
22
22
|
# config.adapter = 'aws_sdk' # This adapter establishes a connection to the DynamoDB servers using Amazon's own AWS gem.
|
23
23
|
# config.access_key = 'access_key' # If connecting to DynamoDB, your access key is required.
|
24
|
-
# config.secret_key = 'secret_key' # So is your secret key.
|
24
|
+
# config.secret_key = 'secret_key' # So is your secret key.
|
25
|
+
# config.endpoint = 'dynamodb.us-east-1.amazonaws.com' # Set the regional endpoint for DynamoDB.
|
25
26
|
config.namespace = "dynamoid_app_development" # To namespace tables created by Dynamoid from other tables you might have.
|
26
27
|
config.warn_on_scan = true # Output a warning to the logger when you perform a scan rather than a query on a table.
|
27
28
|
config.partitioning = true # Spread writes randomly across the database. See "partitioning" below for more.
|
28
29
|
config.partition_size = 200 # Determine the key space size that writes are randomly spread across.
|
29
30
|
config.read_capacity = 100 # Read capacity for your tables
|
30
31
|
config.write_capacity = 20 # Write capacity for your tables
|
31
|
-
config.endpoint = 'dynamodb.us-east-1.amazonaws.com' # Set the regional endpoint
|
32
32
|
end
|
33
33
|
|
34
34
|
```
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.1
|
data/doc/Dynamoid.html
CHANGED
@@ -81,7 +81,7 @@
|
|
81
81
|
|
82
82
|
<dt class="r1 last">Defined in:</dt>
|
83
83
|
<dd class="r1 last">lib/dynamoid/fields.rb<span class="defines">,<br />
|
84
|
-
lib/dynamoid.rb,<br /> lib/dynamoid/
|
84
|
+
lib/dynamoid.rb,<br /> lib/dynamoid/config.rb,<br /> lib/dynamoid/errors.rb,<br /> lib/dynamoid/finders.rb,<br /> lib/dynamoid/indexes.rb,<br /> lib/dynamoid/adapter.rb,<br /> lib/dynamoid/criteria.rb,<br /> lib/dynamoid/document.rb,<br /> lib/dynamoid/components.rb,<br /> lib/dynamoid/validations.rb,<br /> lib/dynamoid/persistence.rb,<br /> lib/dynamoid/associations.rb,<br /> lib/dynamoid/adapter/local.rb,<br /> lib/dynamoid/indexes/index.rb,<br /> lib/dynamoid/criteria/chain.rb,<br /> lib/dynamoid/config/options.rb,<br /> lib/dynamoid/adapter/aws_sdk.rb,<br /> lib/dynamoid/associations/has_one.rb,<br /> lib/dynamoid/associations/has_many.rb,<br /> lib/dynamoid/associations/belongs_to.rb,<br /> lib/dynamoid/associations/association.rb,<br /> lib/dynamoid/associations/many_association.rb,<br /> lib/dynamoid/associations/single_association.rb,<br /> lib/dynamoid/associations/has_and_belongs_to_many.rb</span>
|
85
85
|
</dd>
|
86
86
|
|
87
87
|
</dl>
|
@@ -108,6 +108,18 @@
|
|
108
108
|
|
109
109
|
</p>
|
110
110
|
|
111
|
+
<h2>Constant Summary</h2>
|
112
|
+
|
113
|
+
<dl class="constants">
|
114
|
+
|
115
|
+
<dt id="MAX_ITEM_SIZE-constant" class="">MAX_ITEM_SIZE =
|
116
|
+
|
117
|
+
</dt>
|
118
|
+
<dd><pre class="code"><span class='int'>65_536</span></pre></dd>
|
119
|
+
|
120
|
+
</dl>
|
121
|
+
|
122
|
+
|
111
123
|
|
112
124
|
|
113
125
|
|
@@ -213,13 +225,13 @@
|
|
213
225
|
<pre class="lines">
|
214
226
|
|
215
227
|
|
216
|
-
27
|
217
|
-
28
|
218
228
|
29
|
219
|
-
30
|
229
|
+
30
|
230
|
+
31
|
231
|
+
32</pre>
|
220
232
|
</td>
|
221
233
|
<td>
|
222
|
-
<pre class="code"><span class="info file"># File 'lib/dynamoid.rb', line
|
234
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid.rb', line 29</span>
|
223
235
|
|
224
236
|
<span class='kw'>def</span> <span class='id identifier rubyid_configure'>configure</span>
|
225
237
|
<span class='id identifier rubyid_block_given?'>block_given?</span> <span class='op'>?</span> <span class='kw'>yield</span><span class='lparen'>(</span><span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Config</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Config</span>
|
@@ -243,12 +255,12 @@
|
|
243
255
|
<pre class="lines">
|
244
256
|
|
245
257
|
|
246
|
-
|
247
|
-
|
248
|
-
|
258
|
+
39
|
259
|
+
40
|
260
|
+
41</pre>
|
249
261
|
</td>
|
250
262
|
<td>
|
251
|
-
<pre class="code"><span class="info file"># File 'lib/dynamoid.rb', line
|
263
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid.rb', line 39</span>
|
252
264
|
|
253
265
|
<span class='kw'>def</span> <span class='id identifier rubyid_included_models'>included_models</span>
|
254
266
|
<span class='ivar'>@included_models</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
@@ -271,12 +283,12 @@
|
|
271
283
|
<pre class="lines">
|
272
284
|
|
273
285
|
|
274
|
-
|
275
|
-
|
276
|
-
|
286
|
+
35
|
287
|
+
36
|
288
|
+
37</pre>
|
277
289
|
</td>
|
278
290
|
<td>
|
279
|
-
<pre class="code"><span class="info file"># File 'lib/dynamoid.rb', line
|
291
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid.rb', line 35</span>
|
280
292
|
|
281
293
|
<span class='kw'>def</span> <span class='id identifier rubyid_logger'>logger</span>
|
282
294
|
<span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Config</span><span class='period'>.</span><span class='id identifier rubyid_logger'>logger</span>
|
@@ -291,7 +303,7 @@
|
|
291
303
|
</div>
|
292
304
|
|
293
305
|
<div id="footer">
|
294
|
-
Generated on
|
306
|
+
Generated on Thu Apr 26 01:26:24 2012 by
|
295
307
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
296
308
|
0.7.5 (ruby-1.9.3).
|
297
309
|
</div>
|
data/doc/Dynamoid/Adapter.html
CHANGED
@@ -200,7 +200,7 @@ to Dynamoid.</p>
|
|
200
200
|
<li class="public ">
|
201
201
|
<span class="summary_signature">
|
202
202
|
|
203
|
-
<a href="#delete-instance_method" title="#delete (instance method)">- (Object) <strong>delete</strong>(table, id,
|
203
|
+
<a href="#delete-instance_method" title="#delete (instance method)">- (Object) <strong>delete</strong>(table, id, options = {}) </a>
|
204
204
|
|
205
205
|
|
206
206
|
|
@@ -266,7 +266,7 @@ to Dynamoid.</p>
|
|
266
266
|
<li class="public ">
|
267
267
|
<span class="summary_signature">
|
268
268
|
|
269
|
-
<a href="#read-instance_method" title="#read (instance method)">- (Object) <strong>read</strong>(table, ids,
|
269
|
+
<a href="#read-instance_method" title="#read (instance method)">- (Object) <strong>read</strong>(table, ids, options = {}) </a>
|
270
270
|
|
271
271
|
|
272
272
|
|
@@ -332,7 +332,7 @@ to Dynamoid.</p>
|
|
332
332
|
<li class="public ">
|
333
333
|
<span class="summary_signature">
|
334
334
|
|
335
|
-
<a href="#scan-instance_method" title="#scan (instance method)">- (Object) <strong>scan</strong>(table, query) </a>
|
335
|
+
<a href="#scan-instance_method" title="#scan (instance method)">- (Object) <strong>scan</strong>(table, query, opts = {}) </a>
|
336
336
|
|
337
337
|
|
338
338
|
|
@@ -421,13 +421,13 @@ to Dynamoid.</p>
|
|
421
421
|
<pre class="lines">
|
422
422
|
|
423
423
|
|
424
|
-
168
|
425
424
|
169
|
426
425
|
170
|
427
|
-
171
|
426
|
+
171
|
427
|
+
172</pre>
|
428
428
|
</td>
|
429
429
|
<td>
|
430
|
-
<pre class="code"><span class="info file"># File 'lib/dynamoid/adapter.rb', line
|
430
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/adapter.rb', line 169</span>
|
431
431
|
|
432
432
|
<span class='kw'>def</span> <span class='id identifier rubyid_method_missing'>method_missing</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
|
433
433
|
<span class='kw'>return</span> <span class='id identifier rubyid_benchmark'>benchmark</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='id identifier rubyid_adapter'>adapter</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span><span class='rbrace'>}</span> <span class='kw'>if</span> <span class='ivar'>@adapter</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='rparen'>)</span>
|
@@ -676,7 +676,7 @@ to Dynamoid.</p>
|
|
676
676
|
<div class="method_details ">
|
677
677
|
<p class="signature " id="delete-instance_method">
|
678
678
|
|
679
|
-
- (<tt>Object</tt>) <strong>delete</strong>(table, id,
|
679
|
+
- (<tt>Object</tt>) <strong>delete</strong>(table, id, options = {})
|
680
680
|
|
681
681
|
|
682
682
|
|
@@ -729,8 +729,6 @@ to Dynamoid.</p>
|
|
729
729
|
<span class='type'>(<tt>Number</tt>)</span>
|
730
730
|
|
731
731
|
|
732
|
-
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
733
|
-
|
734
732
|
|
735
733
|
—
|
736
734
|
<div class='inline'><p>the range key of the record</p>
|
@@ -762,7 +760,6 @@ to Dynamoid.</p>
|
|
762
760
|
<pre class="lines">
|
763
761
|
|
764
762
|
|
765
|
-
97
|
766
763
|
98
|
767
764
|
99
|
768
765
|
100
|
@@ -770,18 +767,19 @@ to Dynamoid.</p>
|
|
770
767
|
102
|
771
768
|
103
|
772
769
|
104
|
773
|
-
105
|
770
|
+
105
|
771
|
+
106</pre>
|
774
772
|
</td>
|
775
773
|
<td>
|
776
|
-
<pre class="code"><span class="info file"># File 'lib/dynamoid/adapter.rb', line
|
774
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/adapter.rb', line 98</span>
|
777
775
|
|
778
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_table'>table</span><span class='comma'>,</span> <span class='id identifier rubyid_id'>id</span><span class='comma'>,</span> <span class='id identifier
|
776
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_table'>table</span><span class='comma'>,</span> <span class='id identifier rubyid_id'>id</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
779
777
|
<span class='kw'>if</span> <span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Config</span><span class='period'>.</span><span class='id identifier rubyid_partitioning?'>partitioning?</span>
|
780
778
|
<span class='id identifier rubyid_benchmark'>benchmark</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Delete Item</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span> <span class='kw'>do</span>
|
781
|
-
<span class='id identifier rubyid_id_with_partitions'>id_with_partitions</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_i'>i</span><span class='op'>|</span> <span class='id identifier rubyid_delete_item'>delete_item</span><span class='lparen'>(</span><span class='id identifier rubyid_table'>table</span><span class='comma'>,</span> <span class='id identifier rubyid_i'>i</span><span class='comma'>,</span> <span class='id identifier
|
779
|
+
<span class='id identifier rubyid_id_with_partitions'>id_with_partitions</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_i'>i</span><span class='op'>|</span> <span class='id identifier rubyid_delete_item'>delete_item</span><span class='lparen'>(</span><span class='id identifier rubyid_table'>table</span><span class='comma'>,</span> <span class='id identifier rubyid_i'>i</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span><span class='rbrace'>}</span>
|
782
780
|
<span class='kw'>end</span>
|
783
781
|
<span class='kw'>else</span>
|
784
|
-
<span class='id identifier rubyid_benchmark'>benchmark</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Delete Item</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='id identifier rubyid_delete_item'>delete_item</span><span class='lparen'>(</span><span class='id identifier rubyid_table'>table</span><span class='comma'>,</span> <span class='id identifier rubyid_id'>id</span><span class='comma'>,</span> <span class='id identifier
|
782
|
+
<span class='id identifier rubyid_benchmark'>benchmark</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Delete Item</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='id identifier rubyid_delete_item'>delete_item</span><span class='lparen'>(</span><span class='id identifier rubyid_table'>table</span><span class='comma'>,</span> <span class='id identifier rubyid_id'>id</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span><span class='rbrace'>}</span>
|
785
783
|
<span class='kw'>end</span>
|
786
784
|
<span class='kw'>end</span></pre>
|
787
785
|
</td>
|
@@ -860,12 +858,12 @@ and pass it in unchanged.</p>
|
|
860
858
|
<pre class="lines">
|
861
859
|
|
862
860
|
|
863
|
-
142
|
864
861
|
143
|
865
|
-
144
|
862
|
+
144
|
863
|
+
145</pre>
|
866
864
|
</td>
|
867
865
|
<td>
|
868
|
-
<pre class="code"><span class="info file"># File 'lib/dynamoid/adapter.rb', line
|
866
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/adapter.rb', line 143</span>
|
869
867
|
|
870
868
|
<span class='kw'>def</span> <span class='id identifier rubyid_id_with_partitions'>id_with_partitions</span><span class='lparen'>(</span><span class='id identifier rubyid_ids'>ids</span><span class='rparen'>)</span>
|
871
869
|
<span class='const'>Array</span><span class='lparen'>(</span><span class='id identifier rubyid_ids'>ids</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_id'>id</span><span class='op'>|</span> <span class='lparen'>(</span><span class='int'>0</span><span class='op'>...</span><span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Config</span><span class='period'>.</span><span class='id identifier rubyid_partition_size'>partition_size</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_n'>n</span><span class='op'>|</span> <span class='id identifier rubyid_id'>id</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Array</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='rbrace'>}</span><span class='tstring_content'>.</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_n'>n</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_id'>id</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span><span class='rbracket'>]</span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='rbrace'>}</span><span class='tstring_content'>.</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_n'>n</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span><span class='rbrace'>}</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span><span class='lparen'>(</span><span class='int'>1</span><span class='rparen'>)</span>
|
@@ -878,7 +876,7 @@ and pass it in unchanged.</p>
|
|
878
876
|
<div class="method_details ">
|
879
877
|
<p class="signature " id="read-instance_method">
|
880
878
|
|
881
|
-
- (<tt>Object</tt>) <strong>read</strong>(table, ids,
|
879
|
+
- (<tt>Object</tt>) <strong>read</strong>(table, ids, options = {})
|
882
880
|
|
883
881
|
|
884
882
|
|
@@ -934,8 +932,6 @@ correct record.</p>
|
|
934
932
|
<span class='type'>(<tt>Number</tt>)</span>
|
935
933
|
|
936
934
|
|
937
|
-
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
938
|
-
|
939
935
|
|
940
936
|
—
|
941
937
|
<div class='inline'><p>the range key of the record</p>
|
@@ -985,12 +981,14 @@ correct record.</p>
|
|
985
981
|
85
|
986
982
|
86
|
987
983
|
87
|
988
|
-
88
|
984
|
+
88
|
985
|
+
89</pre>
|
989
986
|
</td>
|
990
987
|
<td>
|
991
988
|
<pre class="code"><span class="info file"># File 'lib/dynamoid/adapter.rb', line 70</span>
|
992
989
|
|
993
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_read'>read</span><span class='lparen'>(</span><span class='id identifier rubyid_table'>table</span><span class='comma'>,</span> <span class='id identifier rubyid_ids'>ids</span><span class='comma'>,</span> <span class='id identifier
|
990
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_read'>read</span><span class='lparen'>(</span><span class='id identifier rubyid_table'>table</span><span class='comma'>,</span> <span class='id identifier rubyid_ids'>ids</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
991
|
+
<span class='id identifier rubyid_range_key'>range_key</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:range_key</span><span class='rbracket'>]</span>
|
994
992
|
<span class='kw'>if</span> <span class='id identifier rubyid_ids'>ids</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:each</span><span class='rparen'>)</span>
|
995
993
|
<span class='id identifier rubyid_ids'>ids</span> <span class='op'>=</span> <span class='id identifier rubyid_ids'>ids</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_id'>id</span><span class='op'>|</span> <span class='id identifier rubyid_range_key'>range_key</span> <span class='op'>?</span> <span class='lbracket'>[</span><span class='id identifier rubyid_id'>id</span><span class='comma'>,</span> <span class='id identifier rubyid_range_key'>range_key</span><span class='rbracket'>]</span> <span class='op'>:</span> <span class='id identifier rubyid_id'>id</span><span class='rbrace'>}</span>
|
996
994
|
<span class='kw'>if</span> <span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Config</span><span class='period'>.</span><span class='id identifier rubyid_partitioning?'>partitioning?</span>
|
@@ -1005,7 +1003,7 @@ correct record.</p>
|
|
1005
1003
|
<span class='id identifier rubyid_results'>results</span> <span class='op'>=</span> <span class='id identifier rubyid_benchmark'>benchmark</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Partitioned Get Item</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_ids'>ids</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='id identifier rubyid_batch_get_item'>batch_get_item</span><span class='lparen'>(</span><span class='id identifier rubyid_table'>table</span> <span class='op'>=></span> <span class='id identifier rubyid_id_with_partitions'>id_with_partitions</span><span class='lparen'>(</span><span class='id identifier rubyid_ids'>ids</span><span class='rparen'>)</span><span class='rparen'>)</span><span class='rbrace'>}</span>
|
1006
1004
|
<span class='id identifier rubyid_result_for_partition'>result_for_partition</span><span class='lparen'>(</span><span class='id identifier rubyid_results'>results</span><span class='lbracket'>[</span><span class='id identifier rubyid_table'>table</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
|
1007
1005
|
<span class='kw'>else</span>
|
1008
|
-
<span class='id identifier rubyid_benchmark'>benchmark</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Get Item</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_ids'>ids</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='id identifier rubyid_get_item'>get_item</span><span class='lparen'>(</span><span class='id identifier rubyid_table'>table</span><span class='comma'>,</span> <span class='id identifier rubyid_ids'>ids</span><span class='comma'>,</span> <span class='id identifier
|
1006
|
+
<span class='id identifier rubyid_benchmark'>benchmark</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Get Item</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_ids'>ids</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='id identifier rubyid_get_item'>get_item</span><span class='lparen'>(</span><span class='id identifier rubyid_table'>table</span><span class='comma'>,</span> <span class='id identifier rubyid_ids'>ids</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span><span class='rbrace'>}</span>
|
1009
1007
|
<span class='kw'>end</span>
|
1010
1008
|
<span class='kw'>end</span>
|
1011
1009
|
<span class='kw'>end</span></pre>
|
@@ -1131,7 +1129,6 @@ their id and updated_at attributes; if the updated_at is the greatest, then it m
|
|
1131
1129
|
<pre class="lines">
|
1132
1130
|
|
1133
1131
|
|
1134
|
-
152
|
1135
1132
|
153
|
1136
1133
|
154
|
1137
1134
|
155
|
@@ -1142,10 +1139,11 @@ their id and updated_at attributes; if the updated_at is the greatest, then it m
|
|
1142
1139
|
160
|
1143
1140
|
161
|
1144
1141
|
162
|
1145
|
-
163
|
1142
|
+
163
|
1143
|
+
164</pre>
|
1146
1144
|
</td>
|
1147
1145
|
<td>
|
1148
|
-
<pre class="code"><span class="info file"># File 'lib/dynamoid/adapter.rb', line
|
1146
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/adapter.rb', line 153</span>
|
1149
1147
|
|
1150
1148
|
<span class='kw'>def</span> <span class='id identifier rubyid_result_for_partition'>result_for_partition</span><span class='lparen'>(</span><span class='id identifier rubyid_results'>results</span><span class='rparen'>)</span>
|
1151
1149
|
<span class='lbrace'>{</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_tap'>tap</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_hash'>hash</span><span class='op'>|</span>
|
@@ -1167,7 +1165,7 @@ their id and updated_at attributes; if the updated_at is the greatest, then it m
|
|
1167
1165
|
<div class="method_details ">
|
1168
1166
|
<p class="signature " id="scan-instance_method">
|
1169
1167
|
|
1170
|
-
- (<tt>Object</tt>) <strong>scan</strong>(table, query)
|
1168
|
+
- (<tt>Object</tt>) <strong>scan</strong>(table, query, opts = {})
|
1171
1169
|
|
1172
1170
|
|
1173
1171
|
|
@@ -1236,24 +1234,24 @@ their id and updated_at attributes; if the updated_at is the greatest, then it m
|
|
1236
1234
|
<pre class="lines">
|
1237
1235
|
|
1238
1236
|
|
1239
|
-
113
|
1240
1237
|
114
|
1241
1238
|
115
|
1242
1239
|
116
|
1243
1240
|
117
|
1244
1241
|
118
|
1245
1242
|
119
|
1246
|
-
120
|
1243
|
+
120
|
1244
|
+
121</pre>
|
1247
1245
|
</td>
|
1248
1246
|
<td>
|
1249
|
-
<pre class="code"><span class="info file"># File 'lib/dynamoid/adapter.rb', line
|
1247
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/adapter.rb', line 114</span>
|
1250
1248
|
|
1251
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_scan'>scan</span><span class='lparen'>(</span><span class='id identifier rubyid_table'>table</span><span class='comma'>,</span> <span class='id identifier rubyid_query'>query</span><span class='rparen'>)</span>
|
1249
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_scan'>scan</span><span class='lparen'>(</span><span class='id identifier rubyid_table'>table</span><span class='comma'>,</span> <span class='id identifier rubyid_query'>query</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
1252
1250
|
<span class='kw'>if</span> <span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Config</span><span class='period'>.</span><span class='id identifier rubyid_partitioning?'>partitioning?</span>
|
1253
|
-
<span class='id identifier rubyid_results'>results</span> <span class='op'>=</span> <span class='id identifier rubyid_benchmark'>benchmark</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Scan</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_table'>table</span><span class='comma'>,</span> <span class='id identifier rubyid_query'>query</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='id identifier rubyid_adapter'>adapter</span><span class='period'>.</span><span class='id identifier rubyid_scan'>scan</span><span class='lparen'>(</span><span class='id identifier rubyid_table'>table</span><span class='comma'>,</span> <span class='id identifier rubyid_query'>query</span><span class='rparen'>)</span><span class='rbrace'>}</span>
|
1251
|
+
<span class='id identifier rubyid_results'>results</span> <span class='op'>=</span> <span class='id identifier rubyid_benchmark'>benchmark</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Scan</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_table'>table</span><span class='comma'>,</span> <span class='id identifier rubyid_query'>query</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='id identifier rubyid_adapter'>adapter</span><span class='period'>.</span><span class='id identifier rubyid_scan'>scan</span><span class='lparen'>(</span><span class='id identifier rubyid_table'>table</span><span class='comma'>,</span> <span class='id identifier rubyid_query'>query</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span><span class='rbrace'>}</span>
|
1254
1252
|
<span class='id identifier rubyid_result_for_partition'>result_for_partition</span><span class='lparen'>(</span><span class='id identifier rubyid_results'>results</span><span class='rparen'>)</span>
|
1255
1253
|
<span class='kw'>else</span>
|
1256
|
-
<span class='id identifier rubyid_adapter'>adapter</span><span class='period'>.</span><span class='id identifier rubyid_scan'>scan</span><span class='lparen'>(</span><span class='id identifier rubyid_table'>table</span><span class='comma'>,</span> <span class='id identifier rubyid_query'>query</span><span class='rparen'>)</span>
|
1254
|
+
<span class='id identifier rubyid_adapter'>adapter</span><span class='period'>.</span><span class='id identifier rubyid_scan'>scan</span><span class='lparen'>(</span><span class='id identifier rubyid_table'>table</span><span class='comma'>,</span> <span class='id identifier rubyid_query'>query</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span>
|
1257
1255
|
<span class='kw'>end</span>
|
1258
1256
|
<span class='kw'>end</span></pre>
|
1259
1257
|
</td>
|
@@ -1378,7 +1376,7 @@ their id and updated_at attributes; if the updated_at is the greatest, then it m
|
|
1378
1376
|
</div>
|
1379
1377
|
|
1380
1378
|
<div id="footer">
|
1381
|
-
Generated on
|
1379
|
+
Generated on Thu Apr 26 01:26:24 2012 by
|
1382
1380
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1383
1381
|
0.7.5 (ruby-1.9.3).
|
1384
1382
|
</div>
|
@@ -215,7 +215,7 @@ More information is available at that Gem's Github page:
|
|
215
215
|
<li class="public ">
|
216
216
|
<span class="summary_signature">
|
217
217
|
|
218
|
-
<a href="#delete_item-instance_method" title="#delete_item (instance method)">- (Object) <strong>delete_item</strong>(table_name, key,
|
218
|
+
<a href="#delete_item-instance_method" title="#delete_item (instance method)">- (Object) <strong>delete_item</strong>(table_name, key, options = {}) </a>
|
219
219
|
|
220
220
|
|
221
221
|
|
@@ -259,7 +259,7 @@ More information is available at that Gem's Github page:
|
|
259
259
|
<li class="public ">
|
260
260
|
<span class="summary_signature">
|
261
261
|
|
262
|
-
<a href="#get_item-instance_method" title="#get_item (instance method)">- (
|
262
|
+
<a href="#get_item-instance_method" title="#get_item (instance method)">- (Object) <strong>get_item</strong>(table_name, key, options = {}) </a>
|
263
263
|
|
264
264
|
|
265
265
|
|
@@ -272,8 +272,28 @@ More information is available at that Gem's Github page:
|
|
272
272
|
|
273
273
|
|
274
274
|
|
275
|
-
<span class="summary_desc"><div class='inline'
|
276
|
-
|
275
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
276
|
+
|
277
|
+
</li>
|
278
|
+
|
279
|
+
|
280
|
+
<li class="public ">
|
281
|
+
<span class="summary_signature">
|
282
|
+
|
283
|
+
<a href="#get_table-instance_method" title="#get_table (instance method)">- (Object) <strong>get_table</strong>(table_name) </a>
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
</span>
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
|
296
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
277
297
|
|
278
298
|
</li>
|
279
299
|
|
@@ -347,7 +367,7 @@ More information is available at that Gem's Github page:
|
|
347
367
|
<li class="public ">
|
348
368
|
<span class="summary_signature">
|
349
369
|
|
350
|
-
<a href="#scan-instance_method" title="#scan (instance method)">- (Array) <strong>scan</strong>(table_name, scan_hash) </a>
|
370
|
+
<a href="#scan-instance_method" title="#scan (instance method)">- (Array) <strong>scan</strong>(table_name, scan_hash, select_opts) </a>
|
351
371
|
|
352
372
|
|
353
373
|
|
@@ -363,6 +383,27 @@ More information is available at that Gem's Github page:
|
|
363
383
|
<span class="summary_desc"><div class='inline'><p>Scan the DynamoDB table.</p>
|
364
384
|
</div></span>
|
365
385
|
|
386
|
+
</li>
|
387
|
+
|
388
|
+
|
389
|
+
<li class="public ">
|
390
|
+
<span class="summary_signature">
|
391
|
+
|
392
|
+
<a href="#table_cache-instance_method" title="#table_cache (instance method)">- (Object) <strong>table_cache</strong> </a>
|
393
|
+
|
394
|
+
|
395
|
+
|
396
|
+
</span>
|
397
|
+
|
398
|
+
|
399
|
+
|
400
|
+
|
401
|
+
|
402
|
+
|
403
|
+
|
404
|
+
|
405
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
406
|
+
|
366
407
|
</li>
|
367
408
|
|
368
409
|
|
@@ -558,7 +599,7 @@ More information is available at that Gem's Github page:
|
|
558
599
|
<pre class="code"><span class="info file"># File 'lib/dynamoid/adapter/aws_sdk.rb', line 20</span>
|
559
600
|
|
560
601
|
<span class='kw'>def</span> <span class='id identifier rubyid_connect!'>connect!</span>
|
561
|
-
<span class='cvar'>@@connection</span> <span class='op'>=</span> <span class='const'>AWS</span><span class='op'>::</span><span class='const'>DynamoDB</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='symbol'>:access_key_id</span> <span class='op'>=></span> <span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Config</span><span class='period'>.</span><span class='id identifier rubyid_access_key'>access_key</span><span class='comma'>,</span> <span class='symbol'>:secret_access_key</span> <span class='op'>=></span> <span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Config</span><span class='period'>.</span><span class='id identifier rubyid_secret_key'>secret_key</span><span class='rparen'>)</span>
|
602
|
+
<span class='cvar'>@@connection</span> <span class='op'>=</span> <span class='const'>AWS</span><span class='op'>::</span><span class='const'>DynamoDB</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='symbol'>:access_key_id</span> <span class='op'>=></span> <span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Config</span><span class='period'>.</span><span class='id identifier rubyid_access_key'>access_key</span><span class='comma'>,</span> <span class='symbol'>:secret_access_key</span> <span class='op'>=></span> <span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Config</span><span class='period'>.</span><span class='id identifier rubyid_secret_key'>secret_key</span><span class='comma'>,</span> <span class='symbol'>:dynamo_db_endpoint</span> <span class='op'>=></span> <span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Config</span><span class='period'>.</span><span class='id identifier rubyid_endpoint'>endpoint</span><span class='rparen'>)</span>
|
562
603
|
<span class='kw'>end</span></pre>
|
563
604
|
</td>
|
564
605
|
</tr>
|
@@ -733,15 +774,13 @@ More information is available at that Gem's Github page:
|
|
733
774
|
69
|
734
775
|
70
|
735
776
|
71
|
736
|
-
72
|
737
|
-
73</pre>
|
777
|
+
72</pre>
|
738
778
|
</td>
|
739
779
|
<td>
|
740
780
|
<pre class="code"><span class="info file"># File 'lib/dynamoid/adapter/aws_sdk.rb', line 65</span>
|
741
781
|
|
742
782
|
<span class='kw'>def</span> <span class='id identifier rubyid_create_table'>create_table</span><span class='lparen'>(</span><span class='id identifier rubyid_table_name'>table_name</span><span class='comma'>,</span> <span class='id identifier rubyid_key'>key</span> <span class='op'>=</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
743
783
|
<span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:hash_key</span><span class='rbracket'>]</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span> <span class='op'>=></span> <span class='symbol'>:string</span><span class='rbrace'>}</span>
|
744
|
-
<span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:range_key</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:range_key</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span> <span class='op'>=></span> <span class='symbol'>:number</span><span class='rbrace'>}</span> <span class='kw'>if</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:range_key</span><span class='rbracket'>]</span>
|
745
784
|
<span class='id identifier rubyid_read_capacity'>read_capacity</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:read_capacity</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Config</span><span class='period'>.</span><span class='id identifier rubyid_read_capacity'>read_capacity</span>
|
746
785
|
<span class='id identifier rubyid_write_capacity'>write_capacity</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:write_capacity</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Config</span><span class='period'>.</span><span class='id identifier rubyid_write_capacity'>write_capacity</span>
|
747
786
|
<span class='id identifier rubyid_table'>table</span> <span class='op'>=</span> <span class='cvar'>@@connection</span><span class='period'>.</span><span class='id identifier rubyid_tables'>tables</span><span class='period'>.</span><span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span><span class='id identifier rubyid_table_name'>table_name</span><span class='comma'>,</span> <span class='id identifier rubyid_read_capacity'>read_capacity</span><span class='comma'>,</span> <span class='id identifier rubyid_write_capacity'>write_capacity</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
@@ -756,7 +795,7 @@ More information is available at that Gem's Github page:
|
|
756
795
|
<div class="method_details ">
|
757
796
|
<p class="signature " id="delete_item-instance_method">
|
758
797
|
|
759
|
-
- (<tt>Object</tt>) <strong>delete_item</strong>(table_name, key,
|
798
|
+
- (<tt>Object</tt>) <strong>delete_item</strong>(table_name, key, options = {})
|
760
799
|
|
761
800
|
|
762
801
|
|
@@ -809,8 +848,6 @@ More information is available at that Gem's Github page:
|
|
809
848
|
<span class='type'>(<tt>Number</tt>)</span>
|
810
849
|
|
811
850
|
|
812
|
-
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
813
|
-
|
814
851
|
|
815
852
|
—
|
816
853
|
<div class='inline'><p>the range key of the item to delete, required if the table has a composite key</p>
|
@@ -842,6 +879,7 @@ More information is available at that Gem's Github page:
|
|
842
879
|
<pre class="lines">
|
843
880
|
|
844
881
|
|
882
|
+
81
|
845
883
|
82
|
846
884
|
83
|
847
885
|
84
|
@@ -851,15 +889,14 @@ More information is available at that Gem's Github page:
|
|
851
889
|
88
|
852
890
|
89
|
853
891
|
90
|
854
|
-
91
|
855
|
-
92</pre>
|
892
|
+
91</pre>
|
856
893
|
</td>
|
857
894
|
<td>
|
858
|
-
<pre class="code"><span class="info file"># File 'lib/dynamoid/adapter/aws_sdk.rb', line
|
895
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/adapter/aws_sdk.rb', line 81</span>
|
859
896
|
|
860
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_delete_item'>delete_item</span><span class='lparen'>(</span><span class='id identifier rubyid_table_name'>table_name</span><span class='comma'>,</span> <span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier
|
861
|
-
<span class='id identifier
|
862
|
-
<span class='id identifier rubyid_table'>table</span><span class='
|
897
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_delete_item'>delete_item</span><span class='lparen'>(</span><span class='id identifier rubyid_table_name'>table_name</span><span class='comma'>,</span> <span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
898
|
+
<span class='id identifier rubyid_range_key'>range_key</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='symbol'>:range_key</span><span class='rparen'>)</span>
|
899
|
+
<span class='id identifier rubyid_table'>table</span> <span class='op'>=</span> <span class='id identifier rubyid_get_table'>get_table</span><span class='lparen'>(</span><span class='id identifier rubyid_table_name'>table_name</span><span class='rparen'>)</span>
|
863
900
|
<span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_composite_key?'>composite_key?</span>
|
864
901
|
<span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_items'>items</span><span class='period'>.</span><span class='id identifier rubyid_at'>at</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_range_key'>range_key</span><span class='rparen'>)</span>
|
865
902
|
<span class='kw'>else</span>
|
@@ -931,12 +968,12 @@ so if you have more this method may raise an exception.</p>
|
|
931
968
|
<pre class="lines">
|
932
969
|
|
933
970
|
|
971
|
+
99
|
934
972
|
100
|
935
|
-
101
|
936
|
-
102</pre>
|
973
|
+
101</pre>
|
937
974
|
</td>
|
938
975
|
<td>
|
939
|
-
<pre class="code"><span class="info file"># File 'lib/dynamoid/adapter/aws_sdk.rb', line
|
976
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/adapter/aws_sdk.rb', line 99</span>
|
940
977
|
|
941
978
|
<span class='kw'>def</span> <span class='id identifier rubyid_delete_table'>delete_table</span><span class='lparen'>(</span><span class='id identifier rubyid_table_name'>table_name</span><span class='rparen'>)</span>
|
942
979
|
<span class='cvar'>@@connection</span><span class='period'>.</span><span class='id identifier rubyid_tables'>tables</span><span class='lbracket'>[</span><span class='id identifier rubyid_table_name'>table_name</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span>
|
@@ -949,111 +986,16 @@ so if you have more this method may raise an exception.</p>
|
|
949
986
|
<div class="method_details ">
|
950
987
|
<p class="signature " id="get_item-instance_method">
|
951
988
|
|
952
|
-
- (<tt>
|
989
|
+
- (<tt>Object</tt>) <strong>get_item</strong>(table_name, key, options = {})
|
953
990
|
|
954
991
|
|
955
992
|
|
956
|
-
</p><
|
957
|
-
<div class="discussion">
|
958
|
-
<p>Fetches an item from DynamoDB.</p>
|
959
|
-
|
960
|
-
|
961
|
-
</div>
|
962
|
-
</div>
|
963
|
-
<div class="tags">
|
964
|
-
<h3>Parameters:</h3>
|
965
|
-
<ul class="param">
|
966
|
-
|
967
|
-
<li>
|
968
|
-
|
969
|
-
<span class='name'>table_name</span>
|
970
|
-
|
971
|
-
|
972
|
-
<span class='type'>(<tt>String</tt>)</span>
|
973
|
-
|
974
|
-
|
975
|
-
|
976
|
-
—
|
977
|
-
<div class='inline'><p>the name of the table</p>
|
978
|
-
</div>
|
979
|
-
|
980
|
-
</li>
|
981
|
-
|
982
|
-
<li>
|
983
|
-
|
984
|
-
<span class='name'>key</span>
|
985
|
-
|
986
|
-
|
987
|
-
<span class='type'>(<tt>String</tt>)</span>
|
988
|
-
|
989
|
-
|
990
|
-
|
991
|
-
—
|
992
|
-
<div class='inline'><p>the hash key of the item to find</p>
|
993
|
-
</div>
|
994
|
-
|
995
|
-
</li>
|
996
|
-
|
997
|
-
<li>
|
998
|
-
|
999
|
-
<span class='name'>range_key</span>
|
1000
|
-
|
1001
|
-
|
1002
|
-
<span class='type'>(<tt>Number</tt>)</span>
|
1003
|
-
|
1004
|
-
|
1005
|
-
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
1006
|
-
|
1007
|
-
|
1008
|
-
—
|
1009
|
-
<div class='inline'><p>the range key of the item to find, required if the table has a composite key</p>
|
1010
|
-
</div>
|
1011
|
-
|
1012
|
-
</li>
|
1013
|
-
|
1014
|
-
</ul>
|
1015
|
-
|
1016
|
-
<h3>Returns:</h3>
|
1017
|
-
<ul class="return">
|
1018
|
-
|
1019
|
-
<li>
|
1020
|
-
|
1021
|
-
|
1022
|
-
<span class='type'>(<tt>Hash</tt>)</span>
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1026
|
-
—
|
1027
|
-
<div class='inline'><p>a hash representing the raw item in DynamoDB</p>
|
1028
|
-
</div>
|
1029
|
-
|
1030
|
-
</li>
|
1031
|
-
|
1032
|
-
</ul>
|
1033
|
-
<h3>Since:</h3>
|
1034
|
-
<ul class="since">
|
1035
|
-
|
1036
|
-
<li>
|
1037
|
-
|
1038
|
-
|
1039
|
-
|
1040
|
-
|
1041
|
-
|
1042
|
-
<div class='inline'><p>0.2.0</p>
|
1043
|
-
</div>
|
1044
|
-
|
1045
|
-
</li>
|
1046
|
-
|
1047
|
-
</ul>
|
1048
|
-
|
1049
|
-
</div><table class="source_code">
|
993
|
+
</p><table class="source_code">
|
1050
994
|
<tr>
|
1051
995
|
<td>
|
1052
996
|
<pre class="lines">
|
1053
997
|
|
1054
998
|
|
1055
|
-
115
|
1056
|
-
116
|
1057
999
|
117
|
1058
1000
|
118
|
1059
1001
|
119
|
@@ -1065,19 +1007,23 @@ so if you have more this method may raise an exception.</p>
|
|
1065
1007
|
125
|
1066
1008
|
126
|
1067
1009
|
127
|
1068
|
-
128
|
1010
|
+
128
|
1011
|
+
129
|
1012
|
+
130
|
1013
|
+
131</pre>
|
1069
1014
|
</td>
|
1070
1015
|
<td>
|
1071
|
-
<pre class="code"><span class="info file"># File 'lib/dynamoid/adapter/aws_sdk.rb', line
|
1016
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/adapter/aws_sdk.rb', line 117</span>
|
1017
|
+
|
1018
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_get_item'>get_item</span><span class='lparen'>(</span><span class='id identifier rubyid_table_name'>table_name</span><span class='comma'>,</span> <span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
1019
|
+
<span class='id identifier rubyid_range_key'>range_key</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='symbol'>:range_key</span><span class='rparen'>)</span>
|
1020
|
+
<span class='id identifier rubyid_table'>table</span> <span class='op'>=</span> <span class='id identifier rubyid_get_table'>get_table</span><span class='lparen'>(</span><span class='id identifier rubyid_table_name'>table_name</span><span class='rparen'>)</span>
|
1072
1021
|
|
1073
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_get_item'>get_item</span><span class='lparen'>(</span><span class='id identifier rubyid_table_name'>table_name</span><span class='comma'>,</span> <span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_range_key'>range_key</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
1074
|
-
<span class='id identifier rubyid_table'>table</span> <span class='op'>=</span> <span class='cvar'>@@connection</span><span class='period'>.</span><span class='id identifier rubyid_tables'>tables</span><span class='lbracket'>[</span><span class='id identifier rubyid_table_name'>table_name</span><span class='rbracket'>]</span>
|
1075
|
-
<span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_load_schema'>load_schema</span>
|
1076
1022
|
<span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_composite_key?'>composite_key?</span>
|
1077
1023
|
<span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_items'>items</span><span class='period'>.</span><span class='id identifier rubyid_at'>at</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_range_key'>range_key</span><span class='rparen'>)</span>
|
1078
1024
|
<span class='kw'>else</span>
|
1079
1025
|
<span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_items'>items</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span>
|
1080
|
-
<span class='kw'>end</span><span class='period'>.</span><span class='id identifier rubyid_attributes'>attributes</span><span class='period'>.</span><span class='id identifier rubyid_to_h'>to_h</span>
|
1026
|
+
<span class='kw'>end</span><span class='period'>.</span><span class='id identifier rubyid_attributes'>attributes</span><span class='period'>.</span><span class='id identifier rubyid_to_h'>to_h</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
1081
1027
|
<span class='kw'>if</span> <span class='id identifier rubyid_result'>result</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
1082
1028
|
<span class='kw'>nil</span>
|
1083
1029
|
<span class='kw'>else</span>
|
@@ -1087,6 +1033,60 @@ so if you have more this method may raise an exception.</p>
|
|
1087
1033
|
</td>
|
1088
1034
|
</tr>
|
1089
1035
|
</table>
|
1036
|
+
</div>
|
1037
|
+
|
1038
|
+
<div class="method_details ">
|
1039
|
+
<p class="signature " id="get_table-instance_method">
|
1040
|
+
|
1041
|
+
- (<tt>Object</tt>) <strong>get_table</strong>(table_name)
|
1042
|
+
|
1043
|
+
|
1044
|
+
|
1045
|
+
</p><div class="docstring">
|
1046
|
+
<div class="discussion">
|
1047
|
+
|
1048
|
+
<div class="note todo">
|
1049
|
+
<strong>TODO:</strong>
|
1050
|
+
<div class='inline'><p>Add an UpdateTable method.</p>
|
1051
|
+
</div>
|
1052
|
+
</div>
|
1053
|
+
|
1054
|
+
|
1055
|
+
|
1056
|
+
</div>
|
1057
|
+
</div>
|
1058
|
+
<div class="tags">
|
1059
|
+
|
1060
|
+
|
1061
|
+
</div><table class="source_code">
|
1062
|
+
<tr>
|
1063
|
+
<td>
|
1064
|
+
<pre class="lines">
|
1065
|
+
|
1066
|
+
|
1067
|
+
202
|
1068
|
+
203
|
1069
|
+
204
|
1070
|
+
205
|
1071
|
+
206
|
1072
|
+
207
|
1073
|
+
208
|
1074
|
+
209</pre>
|
1075
|
+
</td>
|
1076
|
+
<td>
|
1077
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/adapter/aws_sdk.rb', line 202</span>
|
1078
|
+
|
1079
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_get_table'>get_table</span><span class='lparen'>(</span><span class='id identifier rubyid_table_name'>table_name</span><span class='rparen'>)</span>
|
1080
|
+
<span class='kw'>unless</span> <span class='id identifier rubyid_table'>table</span> <span class='op'>=</span> <span class='id identifier rubyid_table_cache'>table_cache</span><span class='lbracket'>[</span><span class='id identifier rubyid_table_name'>table_name</span><span class='rbracket'>]</span>
|
1081
|
+
<span class='id identifier rubyid_table'>table</span> <span class='op'>=</span> <span class='cvar'>@@connection</span><span class='period'>.</span><span class='id identifier rubyid_tables'>tables</span><span class='lbracket'>[</span><span class='id identifier rubyid_table_name'>table_name</span><span class='rbracket'>]</span>
|
1082
|
+
<span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_load_schema'>load_schema</span>
|
1083
|
+
<span class='id identifier rubyid_table_cache'>table_cache</span><span class='lbracket'>[</span><span class='id identifier rubyid_table_name'>table_name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_table'>table</span>
|
1084
|
+
<span class='kw'>end</span>
|
1085
|
+
<span class='id identifier rubyid_table'>table</span>
|
1086
|
+
<span class='kw'>end</span></pre>
|
1087
|
+
</td>
|
1088
|
+
</tr>
|
1089
|
+
</table>
|
1090
1090
|
</div>
|
1091
1091
|
|
1092
1092
|
<div class="method_details ">
|
@@ -1127,12 +1127,12 @@ so if you have more this method may raise an exception.</p>
|
|
1127
1127
|
<pre class="lines">
|
1128
1128
|
|
1129
1129
|
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1130
|
+
136
|
1131
|
+
137
|
1132
|
+
138</pre>
|
1133
1133
|
</td>
|
1134
1134
|
<td>
|
1135
|
-
<pre class="code"><span class="info file"># File 'lib/dynamoid/adapter/aws_sdk.rb', line
|
1135
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/adapter/aws_sdk.rb', line 136</span>
|
1136
1136
|
|
1137
1137
|
<span class='kw'>def</span> <span class='id identifier rubyid_list_tables'>list_tables</span>
|
1138
1138
|
<span class='cvar'>@@connection</span><span class='period'>.</span><span class='id identifier rubyid_tables'>tables</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:name</span><span class='rparen'>)</span>
|
@@ -1214,18 +1214,16 @@ so if you have more this method may raise an exception.</p>
|
|
1214
1214
|
<pre class="lines">
|
1215
1215
|
|
1216
1216
|
|
1217
|
-
143
|
1218
|
-
144
|
1219
|
-
145
|
1220
1217
|
146
|
1221
|
-
147
|
1218
|
+
147
|
1219
|
+
148
|
1220
|
+
149</pre>
|
1222
1221
|
</td>
|
1223
1222
|
<td>
|
1224
|
-
<pre class="code"><span class="info file"># File 'lib/dynamoid/adapter/aws_sdk.rb', line
|
1223
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/adapter/aws_sdk.rb', line 146</span>
|
1225
1224
|
|
1226
1225
|
<span class='kw'>def</span> <span class='id identifier rubyid_put_item'>put_item</span><span class='lparen'>(</span><span class='id identifier rubyid_table_name'>table_name</span><span class='comma'>,</span> <span class='id identifier rubyid_object'>object</span><span class='rparen'>)</span>
|
1227
|
-
<span class='id identifier rubyid_table'>table</span> <span class='op'>=</span> <span class='
|
1228
|
-
<span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_load_schema'>load_schema</span>
|
1226
|
+
<span class='id identifier rubyid_table'>table</span> <span class='op'>=</span> <span class='id identifier rubyid_get_table'>get_table</span><span class='lparen'>(</span><span class='id identifier rubyid_table_name'>table_name</span><span class='rparen'>)</span>
|
1229
1227
|
<span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_items'>items</span><span class='period'>.</span><span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span><span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_delete_if'>delete_if</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>||</span> <span class='lparen'>(</span><span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:empty?</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
1230
1228
|
<span class='kw'>end</span></pre>
|
1231
1229
|
</td>
|
@@ -1397,8 +1395,6 @@ one range key to the hash.</p>
|
|
1397
1395
|
<pre class="lines">
|
1398
1396
|
|
1399
1397
|
|
1400
|
-
165
|
1401
|
-
166
|
1402
1398
|
167
|
1403
1399
|
168
|
1404
1400
|
169
|
@@ -1408,18 +1404,20 @@ one range key to the hash.</p>
|
|
1408
1404
|
173
|
1409
1405
|
174
|
1410
1406
|
175
|
1411
|
-
176
|
1407
|
+
176
|
1408
|
+
177
|
1409
|
+
178</pre>
|
1412
1410
|
</td>
|
1413
1411
|
<td>
|
1414
|
-
<pre class="code"><span class="info file"># File 'lib/dynamoid/adapter/aws_sdk.rb', line
|
1412
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/adapter/aws_sdk.rb', line 167</span>
|
1415
1413
|
|
1416
1414
|
<span class='kw'>def</span> <span class='id identifier rubyid_query'>query</span><span class='lparen'>(</span><span class='id identifier rubyid_table_name'>table_name</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
1417
|
-
<span class='id identifier rubyid_table'>table</span> <span class='op'>=</span> <span class='
|
1418
|
-
|
1419
|
-
|
1415
|
+
<span class='id identifier rubyid_table'>table</span> <span class='op'>=</span> <span class='id identifier rubyid_get_table'>get_table</span><span class='lparen'>(</span><span class='id identifier rubyid_table_name'>table_name</span><span class='rparen'>)</span>
|
1416
|
+
|
1417
|
+
<span class='id identifier rubyid_consistent_opts'>consistent_opts</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='symbol'>:consistent_read</span> <span class='op'>=></span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:consistent_read</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='kw'>false</span> <span class='rbrace'>}</span>
|
1420
1418
|
<span class='kw'>if</span> <span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_composite_key?'>composite_key?</span>
|
1421
1419
|
<span class='id identifier rubyid_results'>results</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
1422
|
-
<span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_items'>items</span><span class='period'>.</span><span class='id identifier rubyid_query'>query</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_data'>data</span><span class='op'>|</span> <span class='id identifier rubyid_results'>results</span> <span class='op'><<</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_attributes'>attributes</span><span class='period'>.</span><span class='id identifier rubyid_to_h'>to_h</span><span class='period'>.</span><span class='id identifier rubyid_symbolize_keys!'>symbolize_keys!</span><span class='rbrace'>}</span>
|
1420
|
+
<span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_items'>items</span><span class='period'>.</span><span class='id identifier rubyid_query'>query</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_data'>data</span><span class='op'>|</span> <span class='id identifier rubyid_results'>results</span> <span class='op'><<</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_attributes'>attributes</span><span class='period'>.</span><span class='id identifier rubyid_to_h'>to_h</span><span class='lparen'>(</span><span class='id identifier rubyid_consistent_opts'>consistent_opts</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_symbolize_keys!'>symbolize_keys!</span><span class='rbrace'>}</span>
|
1423
1421
|
<span class='id identifier rubyid_results'>results</span>
|
1424
1422
|
<span class='kw'>else</span>
|
1425
1423
|
<span class='id identifier rubyid_get_item'>get_item</span><span class='lparen'>(</span><span class='id identifier rubyid_table_name'>table_name</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:hash_value</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
@@ -1433,7 +1431,7 @@ one range key to the hash.</p>
|
|
1433
1431
|
<div class="method_details ">
|
1434
1432
|
<p class="signature " id="scan-instance_method">
|
1435
1433
|
|
1436
|
-
- (<tt>Array</tt>) <strong>scan</strong>(table_name, scan_hash)
|
1434
|
+
- (<tt>Array</tt>) <strong>scan</strong>(table_name, scan_hash, select_opts)
|
1437
1435
|
|
1438
1436
|
|
1439
1437
|
|
@@ -1520,24 +1518,22 @@ the DynamoDB servers.</p>
|
|
1520
1518
|
<pre class="lines">
|
1521
1519
|
|
1522
1520
|
|
1523
|
-
187
|
1524
|
-
188
|
1525
1521
|
189
|
1526
1522
|
190
|
1527
1523
|
191
|
1528
1524
|
192
|
1529
1525
|
193
|
1530
1526
|
194
|
1531
|
-
195
|
1527
|
+
195
|
1528
|
+
196</pre>
|
1532
1529
|
</td>
|
1533
1530
|
<td>
|
1534
|
-
<pre class="code"><span class="info file"># File 'lib/dynamoid/adapter/aws_sdk.rb', line
|
1531
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/adapter/aws_sdk.rb', line 189</span>
|
1535
1532
|
|
1536
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_scan'>scan</span><span class='lparen'>(</span><span class='id identifier rubyid_table_name'>table_name</span><span class='comma'>,</span> <span class='id identifier rubyid_scan_hash'>scan_hash</span><span class='rparen'>)</span>
|
1537
|
-
<span class='id identifier rubyid_table'>table</span> <span class='op'>=</span> <span class='
|
1538
|
-
<span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_load_schema'>load_schema</span>
|
1533
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_scan'>scan</span><span class='lparen'>(</span><span class='id identifier rubyid_table_name'>table_name</span><span class='comma'>,</span> <span class='id identifier rubyid_scan_hash'>scan_hash</span><span class='comma'>,</span> <span class='id identifier rubyid_select_opts'>select_opts</span><span class='rparen'>)</span>
|
1534
|
+
<span class='id identifier rubyid_table'>table</span> <span class='op'>=</span> <span class='id identifier rubyid_get_table'>get_table</span><span class='lparen'>(</span><span class='id identifier rubyid_table_name'>table_name</span><span class='rparen'>)</span>
|
1539
1535
|
<span class='id identifier rubyid_results'>results</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
1540
|
-
<span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_items'>items</span><span class='period'>.</span><span class='id identifier rubyid_where'>where</span><span class='lparen'>(</span><span class='id identifier rubyid_scan_hash'>scan_hash</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_data'>data</span><span class='op'>|</span>
|
1536
|
+
<span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_items'>items</span><span class='period'>.</span><span class='id identifier rubyid_where'>where</span><span class='lparen'>(</span><span class='id identifier rubyid_scan_hash'>scan_hash</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span><span class='lparen'>(</span><span class='id identifier rubyid_select_opts'>select_opts</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_data'>data</span><span class='op'>|</span>
|
1541
1537
|
<span class='id identifier rubyid_results'>results</span> <span class='op'><<</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_attributes'>attributes</span><span class='period'>.</span><span class='id identifier rubyid_symbolize_keys!'>symbolize_keys!</span>
|
1542
1538
|
<span class='kw'>end</span>
|
1543
1539
|
<span class='id identifier rubyid_results'>results</span>
|
@@ -1545,6 +1541,34 @@ the DynamoDB servers.</p>
|
|
1545
1541
|
</td>
|
1546
1542
|
</tr>
|
1547
1543
|
</table>
|
1544
|
+
</div>
|
1545
|
+
|
1546
|
+
<div class="method_details ">
|
1547
|
+
<p class="signature " id="table_cache-instance_method">
|
1548
|
+
|
1549
|
+
- (<tt>Object</tt>) <strong>table_cache</strong>
|
1550
|
+
|
1551
|
+
|
1552
|
+
|
1553
|
+
</p><table class="source_code">
|
1554
|
+
<tr>
|
1555
|
+
<td>
|
1556
|
+
<pre class="lines">
|
1557
|
+
|
1558
|
+
|
1559
|
+
211
|
1560
|
+
212
|
1561
|
+
213</pre>
|
1562
|
+
</td>
|
1563
|
+
<td>
|
1564
|
+
<pre class="code"><span class="info file"># File 'lib/dynamoid/adapter/aws_sdk.rb', line 211</span>
|
1565
|
+
|
1566
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_table_cache'>table_cache</span>
|
1567
|
+
<span class='ivar'>@table_cache</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
1568
|
+
<span class='kw'>end</span></pre>
|
1569
|
+
</td>
|
1570
|
+
</tr>
|
1571
|
+
</table>
|
1548
1572
|
</div>
|
1549
1573
|
|
1550
1574
|
</div>
|
@@ -1552,7 +1576,7 @@ the DynamoDB servers.</p>
|
|
1552
1576
|
</div>
|
1553
1577
|
|
1554
1578
|
<div id="footer">
|
1555
|
-
Generated on
|
1579
|
+
Generated on Thu Apr 26 01:26:26 2012 by
|
1556
1580
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1557
1581
|
0.7.5 (ruby-1.9.3).
|
1558
1582
|
</div>
|