dynamodb_framework 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.idea/workspace.xml +157 -137
- data/README.md +344 -8
- data/lib/dynamodb_framework/dynamodb_repository.rb +11 -11
- data/lib/dynamodb_framework/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb1b773af48a0777219738839d369a94effe8333
|
4
|
+
data.tar.gz: 30829e0621be4deef2588880d4a754296c0043c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6dc92faa4bafbe9d1fc4981c17aea0996df81e5e42532a617a07d5868247c09773d68316ab888ff69b24be0242164a5516dcde48adbdb935dbb61456e0106e72
|
7
|
+
data.tar.gz: 0d281cb9f589e24a86491d27f3a861708837e17f1e44dfb428d746323ab6144612d9f4e108e39f938f9fbc67c1646d837f273340354e4603f0affcd92ceaeb81
|
data/.idea/workspace.xml
CHANGED
@@ -2,8 +2,7 @@
|
|
2
2
|
<project version="4">
|
3
3
|
<component name="ChangeListManager">
|
4
4
|
<list default="true" id="e6e52ba6-fb1e-45c4-b31f-2a2931ecfa44" name="Default" comment="">
|
5
|
-
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/dynamodb_framework.
|
6
|
-
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/dynamodb_framework.iml" afterPath="$PROJECT_DIR$/.idea/dynamodb_framework.iml" />
|
5
|
+
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/dynamodb_framework/version.rb" afterPath="$PROJECT_DIR$/lib/dynamodb_framework/version.rb" />
|
7
6
|
</list>
|
8
7
|
<ignored path="dynamodb_framework.iws" />
|
9
8
|
<ignored path=".idea/workspace.xml" />
|
@@ -24,101 +23,46 @@
|
|
24
23
|
</component>
|
25
24
|
<component name="FileEditorManager">
|
26
25
|
<leaf>
|
27
|
-
<file leaf-file-name="
|
28
|
-
<entry file="file://$PROJECT_DIR$/
|
26
|
+
<file leaf-file-name="dynamodb_repository.rb" pinned="false" current-in-tab="false">
|
27
|
+
<entry file="file://$PROJECT_DIR$/lib/dynamodb_framework/dynamodb_repository.rb">
|
29
28
|
<provider selected="true" editor-type-id="text-editor">
|
30
29
|
<state vertical-scroll-proportion="0.0">
|
31
|
-
<caret line="
|
32
|
-
<folding
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
<entry file="file://$PROJECT_DIR$/dynamodb_framework.gemspec">
|
39
|
-
<provider selected="true" editor-type-id="text-editor">
|
40
|
-
<state vertical-scroll-proportion="0.1558753">
|
41
|
-
<caret line="13" column="80" selection-start-line="13" selection-start-column="80" selection-end-line="13" selection-end-column="80" />
|
42
|
-
<folding />
|
43
|
-
</state>
|
44
|
-
</provider>
|
45
|
-
</entry>
|
46
|
-
</file>
|
47
|
-
<file leaf-file-name="spec_helper.rb" pinned="false" current-in-tab="false">
|
48
|
-
<entry file="file://$PROJECT_DIR$/spec/spec_helper.rb">
|
49
|
-
<provider selected="true" editor-type-id="text-editor">
|
50
|
-
<state vertical-scroll-proportion="0.0">
|
51
|
-
<caret line="8" column="28" selection-start-line="8" selection-start-column="28" selection-end-line="8" selection-end-column="28" />
|
52
|
-
<folding />
|
30
|
+
<caret line="119" column="186" selection-start-line="119" selection-start-column="186" selection-end-line="119" selection-end-column="186" />
|
31
|
+
<folding>
|
32
|
+
<element signature="e#530#888#0" expanded="false" />
|
33
|
+
<element signature="e#892#1149#0" expanded="false" />
|
34
|
+
<element signature="e#1153#2133#0" expanded="false" />
|
35
|
+
<element signature="e#2137#3853#0" expanded="false" />
|
36
|
+
</folding>
|
53
37
|
</state>
|
54
38
|
</provider>
|
55
39
|
</entry>
|
56
40
|
</file>
|
57
|
-
<file leaf-file-name="
|
58
|
-
<entry file="file://$PROJECT_DIR$/spec/
|
59
|
-
<provider selected="true" editor-type-id="text-editor">
|
60
|
-
<state vertical-scroll-proportion="0.0">
|
61
|
-
<caret line="5" column="3" selection-start-line="5" selection-start-column="3" selection-end-line="5" selection-end-column="3" />
|
62
|
-
<folding />
|
63
|
-
</state>
|
64
|
-
</provider>
|
65
|
-
</entry>
|
66
|
-
</file>
|
67
|
-
<file leaf-file-name="test_migration_script1.rb" pinned="false" current-in-tab="false">
|
68
|
-
<entry file="file://$PROJECT_DIR$/spec/test_migration_script1.rb">
|
69
|
-
<provider selected="true" editor-type-id="text-editor">
|
70
|
-
<state vertical-scroll-proportion="0.0">
|
71
|
-
<caret line="22" column="3" selection-start-line="22" selection-start-column="3" selection-end-line="22" selection-end-column="3" />
|
72
|
-
<folding />
|
73
|
-
</state>
|
74
|
-
</provider>
|
75
|
-
</entry>
|
76
|
-
</file>
|
77
|
-
<file leaf-file-name="test_migration_script2.rb" pinned="false" current-in-tab="false">
|
78
|
-
<entry file="file://$PROJECT_DIR$/spec/test_migration_script2.rb">
|
79
|
-
<provider selected="true" editor-type-id="text-editor">
|
80
|
-
<state vertical-scroll-proportion="0.0">
|
81
|
-
<caret line="22" column="3" selection-start-line="22" selection-start-column="3" selection-end-line="22" selection-end-column="3" />
|
82
|
-
<folding />
|
83
|
-
</state>
|
84
|
-
</provider>
|
85
|
-
</entry>
|
86
|
-
</file>
|
87
|
-
<file leaf-file-name="dynamodb_framework.rb" pinned="false" current-in-tab="false">
|
88
|
-
<entry file="file://$PROJECT_DIR$/lib/dynamodb_framework.rb">
|
89
|
-
<provider selected="true" editor-type-id="text-editor">
|
90
|
-
<state vertical-scroll-proportion="0.0">
|
91
|
-
<caret line="6" column="53" selection-start-line="6" selection-start-column="53" selection-end-line="6" selection-end-column="53" />
|
92
|
-
<folding />
|
93
|
-
</state>
|
94
|
-
</provider>
|
95
|
-
</entry>
|
96
|
-
</file>
|
97
|
-
<file leaf-file-name="dynamodb_migration_manager_spec.rb" pinned="false" current-in-tab="false">
|
98
|
-
<entry file="file://$PROJECT_DIR$/spec/dynamodb_migration_manager_spec.rb">
|
41
|
+
<file leaf-file-name="dynamodb_repository_spec.rb" pinned="false" current-in-tab="false">
|
42
|
+
<entry file="file://$PROJECT_DIR$/spec/dynamodb_repository_spec.rb">
|
99
43
|
<provider selected="true" editor-type-id="text-editor">
|
100
44
|
<state vertical-scroll-proportion="0.0">
|
101
|
-
<caret line="
|
45
|
+
<caret line="192" column="133" selection-start-line="192" selection-start-column="6" selection-end-line="192" selection-end-column="133" />
|
102
46
|
<folding />
|
103
47
|
</state>
|
104
48
|
</provider>
|
105
49
|
</entry>
|
106
50
|
</file>
|
107
|
-
<file leaf-file-name="
|
108
|
-
<entry file="file://$PROJECT_DIR$/
|
51
|
+
<file leaf-file-name="README.md" pinned="false" current-in-tab="false">
|
52
|
+
<entry file="file://$PROJECT_DIR$/README.md">
|
109
53
|
<provider selected="true" editor-type-id="text-editor">
|
110
|
-
<state vertical-scroll-proportion="
|
111
|
-
<caret line="
|
54
|
+
<state vertical-scroll-proportion="-37.0">
|
55
|
+
<caret line="367" column="77" selection-start-line="367" selection-start-column="77" selection-end-line="367" selection-end-column="77" />
|
112
56
|
<folding />
|
113
57
|
</state>
|
114
58
|
</provider>
|
115
59
|
</entry>
|
116
60
|
</file>
|
117
|
-
<file leaf-file-name="
|
118
|
-
<entry file="file://$PROJECT_DIR$/
|
61
|
+
<file leaf-file-name="version.rb" pinned="false" current-in-tab="true">
|
62
|
+
<entry file="file://$PROJECT_DIR$/lib/dynamodb_framework/version.rb">
|
119
63
|
<provider selected="true" editor-type-id="text-editor">
|
120
|
-
<state vertical-scroll-proportion="0.
|
121
|
-
<caret line="
|
64
|
+
<state vertical-scroll-proportion="0.0119904075">
|
65
|
+
<caret line="1" column="18" selection-start-line="1" selection-start-column="18" selection-end-line="1" selection-end-column="18" />
|
122
66
|
<folding />
|
123
67
|
</state>
|
124
68
|
</provider>
|
@@ -135,7 +79,6 @@
|
|
135
79
|
<option value="$PROJECT_DIR$/.gitignore" />
|
136
80
|
<option value="$PROJECT_DIR$/lib/dynamodb_framework/dynamodb_attributes_builder.rb" />
|
137
81
|
<option value="$PROJECT_DIR$/lib/dynamodb_framework/dynamodb_migration_manager.rb" />
|
138
|
-
<option value="$PROJECT_DIR$/lib/dynamodb_framework/dynamodb_repository.rb" />
|
139
82
|
<option value="$PROJECT_DIR$/lib/dynamodb_framework/dynamodb_store.rb" />
|
140
83
|
<option value="$PROJECT_DIR$/lib/dynamodb_framework/dynamodb_table_manager.rb" />
|
141
84
|
<option value="$PROJECT_DIR$/lib/dynamodb_framework/dynamodb_migration_script.rb" />
|
@@ -150,6 +93,9 @@
|
|
150
93
|
<option value="$PROJECT_DIR$/spec/spec_helper.rb" />
|
151
94
|
<option value="$PROJECT_DIR$/Gemfile" />
|
152
95
|
<option value="$PROJECT_DIR$/dynamodb_framework.gemspec" />
|
96
|
+
<option value="$PROJECT_DIR$/lib/dynamodb_framework/dynamodb_repository.rb" />
|
97
|
+
<option value="$PROJECT_DIR$/README.md" />
|
98
|
+
<option value="$PROJECT_DIR$/lib/dynamodb_framework/version.rb" />
|
153
99
|
</list>
|
154
100
|
</option>
|
155
101
|
</component>
|
@@ -208,6 +154,52 @@
|
|
208
154
|
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
209
155
|
</PATH_ELEMENT>
|
210
156
|
</PATH>
|
157
|
+
<PATH>
|
158
|
+
<PATH_ELEMENT>
|
159
|
+
<option name="myItemId" value="dynamodb_framework" />
|
160
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
161
|
+
</PATH_ELEMENT>
|
162
|
+
<PATH_ELEMENT>
|
163
|
+
<option name="myItemId" value="dynamodb_framework" />
|
164
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
165
|
+
</PATH_ELEMENT>
|
166
|
+
<PATH_ELEMENT>
|
167
|
+
<option name="myItemId" value="spec" />
|
168
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
169
|
+
</PATH_ELEMENT>
|
170
|
+
</PATH>
|
171
|
+
<PATH>
|
172
|
+
<PATH_ELEMENT>
|
173
|
+
<option name="myItemId" value="dynamodb_framework" />
|
174
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
175
|
+
</PATH_ELEMENT>
|
176
|
+
<PATH_ELEMENT>
|
177
|
+
<option name="myItemId" value="dynamodb_framework" />
|
178
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
179
|
+
</PATH_ELEMENT>
|
180
|
+
<PATH_ELEMENT>
|
181
|
+
<option name="myItemId" value="lib" />
|
182
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
183
|
+
</PATH_ELEMENT>
|
184
|
+
</PATH>
|
185
|
+
<PATH>
|
186
|
+
<PATH_ELEMENT>
|
187
|
+
<option name="myItemId" value="dynamodb_framework" />
|
188
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
189
|
+
</PATH_ELEMENT>
|
190
|
+
<PATH_ELEMENT>
|
191
|
+
<option name="myItemId" value="dynamodb_framework" />
|
192
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
193
|
+
</PATH_ELEMENT>
|
194
|
+
<PATH_ELEMENT>
|
195
|
+
<option name="myItemId" value="lib" />
|
196
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
197
|
+
</PATH_ELEMENT>
|
198
|
+
<PATH_ELEMENT>
|
199
|
+
<option name="myItemId" value="dynamodb_framework" />
|
200
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
201
|
+
</PATH_ELEMENT>
|
202
|
+
</PATH>
|
211
203
|
</subPane>
|
212
204
|
</pane>
|
213
205
|
<pane id="Scratches" />
|
@@ -290,6 +282,26 @@
|
|
290
282
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="FULL_BACKTRACE" VALUE="false" />
|
291
283
|
<method />
|
292
284
|
</configuration>
|
285
|
+
<configuration default="true" type="RubyRunConfigurationType" factoryName="Ruby">
|
286
|
+
<module name="" />
|
287
|
+
<RUBY_RUN_CONFIG NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
|
288
|
+
<RUBY_RUN_CONFIG NAME="WORK DIR" VALUE="" />
|
289
|
+
<RUBY_RUN_CONFIG NAME="SHOULD_USE_SDK" VALUE="false" />
|
290
|
+
<RUBY_RUN_CONFIG NAME="ALTERN_SDK_NAME" VALUE="" />
|
291
|
+
<RUBY_RUN_CONFIG NAME="myPassParentEnvs" VALUE="true" />
|
292
|
+
<envs />
|
293
|
+
<EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
|
294
|
+
<EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
|
295
|
+
<EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
|
296
|
+
<COVERAGE_PATTERN ENABLED="true">
|
297
|
+
<PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
|
298
|
+
</COVERAGE_PATTERN>
|
299
|
+
</EXTENSION>
|
300
|
+
<EXTENSION ID="org.jetbrains.plugins.ruby.motion.run.MotionSimulatorRunExtension" />
|
301
|
+
<RUBY_RUN_CONFIG NAME="SCRIPT_PATH" VALUE="" />
|
302
|
+
<RUBY_RUN_CONFIG NAME="SCRIPT_ARGS" VALUE="" />
|
303
|
+
<method />
|
304
|
+
</configuration>
|
293
305
|
<configuration default="true" type="TestUnitRunConfigurationType" factoryName="Test::Unit/Shoulda/Minitest">
|
294
306
|
<predefined_log_file id="RUBY_TESTUNIT" enabled="true" />
|
295
307
|
<module name="" />
|
@@ -372,118 +384,98 @@
|
|
372
384
|
</state>
|
373
385
|
</provider>
|
374
386
|
</entry>
|
375
|
-
<entry file="file://$PROJECT_DIR$/lib/dynamodb_framework/
|
387
|
+
<entry file="file://$PROJECT_DIR$/lib/dynamodb_framework/dynamodb_attributes_builder.rb">
|
376
388
|
<provider selected="true" editor-type-id="text-editor">
|
377
389
|
<state vertical-scroll-proportion="0.0">
|
378
|
-
<caret line="
|
390
|
+
<caret line="19" column="3" selection-start-line="19" selection-start-column="3" selection-end-line="19" selection-end-column="3" />
|
379
391
|
<folding />
|
380
392
|
</state>
|
381
393
|
</provider>
|
382
394
|
</entry>
|
383
|
-
<entry file="file://$PROJECT_DIR$/lib/dynamodb_framework/
|
395
|
+
<entry file="file://$PROJECT_DIR$/lib/dynamodb_framework/dynamodb_store.rb">
|
384
396
|
<provider selected="true" editor-type-id="text-editor">
|
385
397
|
<state vertical-scroll-proportion="0.0">
|
386
|
-
<caret line="
|
398
|
+
<caret line="15" column="3" selection-start-line="15" selection-start-column="3" selection-end-line="15" selection-end-column="3" />
|
387
399
|
<folding />
|
388
400
|
</state>
|
389
401
|
</provider>
|
390
402
|
</entry>
|
391
|
-
<entry file="file://$PROJECT_DIR
|
403
|
+
<entry file="file://$PROJECT_DIR$/.rspec">
|
392
404
|
<provider selected="true" editor-type-id="text-editor">
|
393
405
|
<state vertical-scroll-proportion="0.0">
|
394
|
-
<caret line="
|
406
|
+
<caret line="2" column="12" selection-start-line="2" selection-start-column="12" selection-end-line="2" selection-end-column="12" />
|
395
407
|
<folding />
|
396
408
|
</state>
|
397
409
|
</provider>
|
398
410
|
</entry>
|
399
|
-
<entry file="file://$PROJECT_DIR$/lib/dynamodb_framework
|
411
|
+
<entry file="file://$PROJECT_DIR$/lib/dynamodb_framework.rb">
|
400
412
|
<provider selected="true" editor-type-id="text-editor">
|
401
413
|
<state vertical-scroll-proportion="0.0">
|
402
|
-
<caret line="
|
403
|
-
<folding
|
404
|
-
<element signature="e#528#866#0" expanded="false" />
|
405
|
-
<element signature="e#870#1127#0" expanded="false" />
|
406
|
-
<element signature="e#1131#2111#0" expanded="false" />
|
407
|
-
<element signature="e#2115#3761#0" expanded="false" />
|
408
|
-
</folding>
|
414
|
+
<caret line="6" column="53" selection-start-line="6" selection-start-column="53" selection-end-line="6" selection-end-column="53" />
|
415
|
+
<folding />
|
409
416
|
</state>
|
410
417
|
</provider>
|
411
418
|
</entry>
|
412
|
-
<entry file="file://$PROJECT_DIR$/
|
419
|
+
<entry file="file://$PROJECT_DIR$/spec/test_migration_script2.rb">
|
413
420
|
<provider selected="true" editor-type-id="text-editor">
|
414
421
|
<state vertical-scroll-proportion="0.0">
|
415
|
-
<caret line="
|
422
|
+
<caret line="22" column="3" selection-start-line="22" selection-start-column="3" selection-end-line="22" selection-end-column="3" />
|
416
423
|
<folding />
|
417
424
|
</state>
|
418
425
|
</provider>
|
419
426
|
</entry>
|
420
|
-
<entry file="file://$PROJECT_DIR$/
|
427
|
+
<entry file="file://$PROJECT_DIR$/spec/test_item.rb">
|
421
428
|
<provider selected="true" editor-type-id="text-editor">
|
422
429
|
<state vertical-scroll-proportion="0.0">
|
423
|
-
<caret line="
|
424
|
-
<folding
|
425
|
-
<element signature="e#113#345#0" expanded="false" />
|
426
|
-
<element signature="e#349#862#0" expanded="false" />
|
427
|
-
<element signature="e#866#1449#0" expanded="false" />
|
428
|
-
<element signature="e#1453#2109#0" expanded="false" />
|
429
|
-
<element signature="e#2113#2858#0" expanded="false" />
|
430
|
-
<element signature="e#2862#3321#0" expanded="false" />
|
431
|
-
<element signature="e#3325#3467#0" expanded="false" />
|
432
|
-
<element signature="e#3471#3855#0" expanded="false" />
|
433
|
-
<element signature="e#3859#4181#0" expanded="false" />
|
434
|
-
<element signature="e#4185#4565#0" expanded="false" />
|
435
|
-
<element signature="e#4569#4942#0" expanded="false" />
|
436
|
-
<element signature="e#4946#6146#0" expanded="false" />
|
437
|
-
<element signature="e#6150#6794#0" expanded="false" />
|
438
|
-
<element signature="e#6798#7026#0" expanded="false" />
|
439
|
-
</folding>
|
430
|
+
<caret line="5" column="3" selection-start-line="5" selection-start-column="3" selection-end-line="5" selection-end-column="3" />
|
431
|
+
<folding />
|
440
432
|
</state>
|
441
433
|
</provider>
|
442
434
|
</entry>
|
443
|
-
<entry file="file://$PROJECT_DIR$/
|
435
|
+
<entry file="file://$PROJECT_DIR$/spec/spec_helper.rb">
|
444
436
|
<provider selected="true" editor-type-id="text-editor">
|
445
437
|
<state vertical-scroll-proportion="0.0">
|
446
|
-
<caret line="
|
438
|
+
<caret line="8" column="28" selection-start-line="8" selection-start-column="28" selection-end-line="8" selection-end-column="28" />
|
447
439
|
<folding />
|
448
440
|
</state>
|
449
441
|
</provider>
|
450
442
|
</entry>
|
451
|
-
<entry file="file://$PROJECT_DIR
|
443
|
+
<entry file="file://$PROJECT_DIR$/Gemfile">
|
452
444
|
<provider selected="true" editor-type-id="text-editor">
|
453
445
|
<state vertical-scroll-proportion="0.0">
|
454
|
-
<caret line="
|
446
|
+
<caret line="4" column="0" selection-start-line="4" selection-start-column="0" selection-end-line="4" selection-end-column="0" />
|
455
447
|
<folding />
|
456
448
|
</state>
|
457
449
|
</provider>
|
458
450
|
</entry>
|
459
|
-
<entry file="file://$PROJECT_DIR$/
|
451
|
+
<entry file="file://$PROJECT_DIR$/dynamodb_framework.gemspec">
|
460
452
|
<provider selected="true" editor-type-id="text-editor">
|
461
453
|
<state vertical-scroll-proportion="0.0">
|
462
|
-
<caret line="
|
454
|
+
<caret line="13" column="80" selection-start-line="13" selection-start-column="80" selection-end-line="13" selection-end-column="80" />
|
463
455
|
<folding />
|
464
456
|
</state>
|
465
457
|
</provider>
|
466
458
|
</entry>
|
467
|
-
<entry file="file://$PROJECT_DIR$/
|
459
|
+
<entry file="file://$PROJECT_DIR$/lib/dynamodb_framework/dynamodb_migration_script.rb">
|
468
460
|
<provider selected="true" editor-type-id="text-editor">
|
469
461
|
<state vertical-scroll-proportion="0.0">
|
470
|
-
<caret line="
|
462
|
+
<caret line="14" column="0" selection-start-line="14" selection-start-column="0" selection-end-line="14" selection-end-column="0" />
|
471
463
|
<folding />
|
472
464
|
</state>
|
473
465
|
</provider>
|
474
466
|
</entry>
|
475
|
-
<entry file="file://$PROJECT_DIR$/spec/
|
467
|
+
<entry file="file://$PROJECT_DIR$/spec/dynamodb_table_manager_spec.rb">
|
476
468
|
<provider selected="true" editor-type-id="text-editor">
|
477
469
|
<state vertical-scroll-proportion="0.0">
|
478
|
-
<caret line="
|
470
|
+
<caret line="0" column="9" selection-start-line="0" selection-start-column="9" selection-end-line="0" selection-end-column="9" />
|
479
471
|
<folding />
|
480
472
|
</state>
|
481
473
|
</provider>
|
482
474
|
</entry>
|
483
|
-
<entry file="file://$PROJECT_DIR$/spec/
|
475
|
+
<entry file="file://$PROJECT_DIR$/spec/test_migration_script1.rb">
|
484
476
|
<provider selected="true" editor-type-id="text-editor">
|
485
477
|
<state vertical-scroll-proportion="0.0">
|
486
|
-
<caret line="
|
478
|
+
<caret line="22" column="3" selection-start-line="22" selection-start-column="3" selection-end-line="22" selection-end-column="3" />
|
487
479
|
<folding />
|
488
480
|
</state>
|
489
481
|
</provider>
|
@@ -496,42 +488,70 @@
|
|
496
488
|
</state>
|
497
489
|
</provider>
|
498
490
|
</entry>
|
499
|
-
<entry file="file://$PROJECT_DIR$/
|
491
|
+
<entry file="file://$PROJECT_DIR$/lib/dynamodb_framework/dynamodb_table_manager.rb">
|
500
492
|
<provider selected="true" editor-type-id="text-editor">
|
501
493
|
<state vertical-scroll-proportion="0.0">
|
502
|
-
<caret line="
|
503
|
-
<folding
|
494
|
+
<caret line="282" column="3" selection-start-line="282" selection-start-column="3" selection-end-line="282" selection-end-column="3" />
|
495
|
+
<folding>
|
496
|
+
<element signature="e#113#345#0" expanded="false" />
|
497
|
+
<element signature="e#349#862#0" expanded="false" />
|
498
|
+
<element signature="e#866#1449#0" expanded="false" />
|
499
|
+
<element signature="e#1453#2109#0" expanded="false" />
|
500
|
+
<element signature="e#2113#2858#0" expanded="false" />
|
501
|
+
<element signature="e#2862#3321#0" expanded="false" />
|
502
|
+
<element signature="e#3325#3467#0" expanded="false" />
|
503
|
+
<element signature="e#3471#3855#0" expanded="false" />
|
504
|
+
<element signature="e#3859#4181#0" expanded="false" />
|
505
|
+
<element signature="e#4185#4565#0" expanded="false" />
|
506
|
+
<element signature="e#4569#4942#0" expanded="false" />
|
507
|
+
<element signature="e#4946#6146#0" expanded="false" />
|
508
|
+
<element signature="e#6150#6794#0" expanded="false" />
|
509
|
+
<element signature="e#6798#7026#0" expanded="false" />
|
510
|
+
</folding>
|
504
511
|
</state>
|
505
512
|
</provider>
|
506
513
|
</entry>
|
507
|
-
<entry file="file://$PROJECT_DIR$/
|
514
|
+
<entry file="file://$PROJECT_DIR$/lib/dynamodb_framework/dynamodb_migration_manager.rb">
|
508
515
|
<provider selected="true" editor-type-id="text-editor">
|
509
516
|
<state vertical-scroll-proportion="0.0">
|
510
|
-
<caret line="
|
517
|
+
<caret line="34" column="5" selection-start-line="34" selection-start-column="5" selection-end-line="34" selection-end-column="5" />
|
511
518
|
<folding />
|
512
519
|
</state>
|
513
520
|
</provider>
|
514
521
|
</entry>
|
515
|
-
<entry file="file://$PROJECT_DIR$/
|
522
|
+
<entry file="file://$PROJECT_DIR$/lib/dynamodb_framework/dynamodb_repository.rb">
|
516
523
|
<provider selected="true" editor-type-id="text-editor">
|
517
524
|
<state vertical-scroll-proportion="0.0">
|
518
|
-
<caret line="
|
519
|
-
<folding
|
525
|
+
<caret line="119" column="186" selection-start-line="119" selection-start-column="186" selection-end-line="119" selection-end-column="186" />
|
526
|
+
<folding>
|
527
|
+
<element signature="e#530#888#0" expanded="false" />
|
528
|
+
<element signature="e#892#1149#0" expanded="false" />
|
529
|
+
<element signature="e#1153#2133#0" expanded="false" />
|
530
|
+
<element signature="e#2137#3853#0" expanded="false" />
|
531
|
+
</folding>
|
520
532
|
</state>
|
521
533
|
</provider>
|
522
534
|
</entry>
|
523
|
-
<entry file="file://$PROJECT_DIR$/
|
535
|
+
<entry file="file://$PROJECT_DIR$/spec/dynamodb_repository_spec.rb">
|
524
536
|
<provider selected="true" editor-type-id="text-editor">
|
525
537
|
<state vertical-scroll-proportion="0.0">
|
526
|
-
<caret line="
|
538
|
+
<caret line="192" column="133" selection-start-line="192" selection-start-column="6" selection-end-line="192" selection-end-column="133" />
|
527
539
|
<folding />
|
528
540
|
</state>
|
529
541
|
</provider>
|
530
542
|
</entry>
|
531
|
-
<entry file="file://$PROJECT_DIR$/
|
543
|
+
<entry file="file://$PROJECT_DIR$/README.md">
|
532
544
|
<provider selected="true" editor-type-id="text-editor">
|
533
|
-
<state vertical-scroll-proportion="0
|
534
|
-
<caret line="
|
545
|
+
<state vertical-scroll-proportion="-37.0">
|
546
|
+
<caret line="367" column="77" selection-start-line="367" selection-start-column="77" selection-end-line="367" selection-end-column="77" />
|
547
|
+
<folding />
|
548
|
+
</state>
|
549
|
+
</provider>
|
550
|
+
</entry>
|
551
|
+
<entry file="file://$PROJECT_DIR$/lib/dynamodb_framework/version.rb">
|
552
|
+
<provider selected="true" editor-type-id="text-editor">
|
553
|
+
<state vertical-scroll-proportion="0.0119904075">
|
554
|
+
<caret line="1" column="18" selection-start-line="1" selection-start-column="18" selection-end-line="1" selection-end-column="18" />
|
535
555
|
<folding />
|
536
556
|
</state>
|
537
557
|
</provider>
|
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# DynamoDb_Framework
|
2
2
|
|
3
|
-
Welcome to
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
Welcome to DynamoDb_Framework, this is a light weight framework that provides managers to help with interacting with aws dynamodb.
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
@@ -22,7 +20,346 @@ Or install it yourself as:
|
|
22
20
|
|
23
21
|
## Usage
|
24
22
|
|
25
|
-
|
23
|
+
# MigrationScripts
|
24
|
+
To create or modify a DynamoDb instance you first need to create a migration script:
|
25
|
+
|
26
|
+
**Example**
|
27
|
+
|
28
|
+
class CreateEventTrackingTableScript < MigrationScript
|
29
|
+
|
30
|
+
def initialize
|
31
|
+
#set the timestamp for when this script was created
|
32
|
+
@timestamp = '20160318110710'
|
33
|
+
end
|
34
|
+
|
35
|
+
def apply
|
36
|
+
#create an instance of the table manager
|
37
|
+
manager = DynamoDbTableManager.new
|
38
|
+
#create an attribute builder
|
39
|
+
builder = DynamoDbAttributesBuilder.new
|
40
|
+
|
41
|
+
#set the hash key attribute
|
42
|
+
builder.add(:type, :S)
|
43
|
+
|
44
|
+
#create the table
|
45
|
+
manager.create('event_tracking', builder.attributes, :type)
|
46
|
+
end
|
47
|
+
def undo
|
48
|
+
|
49
|
+
#create an instance of the table manager
|
50
|
+
manager = DynamoDbTableManager.new
|
51
|
+
|
52
|
+
#drop the table
|
53
|
+
manager.drop('event_tracking')
|
54
|
+
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
Each migration script should have a unique fixed timestamp value of the following format:
|
59
|
+
|
60
|
+
yyyymmddhhMMss
|
61
|
+
|
62
|
+
**Example**
|
63
|
+
|
64
|
+
11:07:10 18-03-2016 would be:
|
65
|
+
|
66
|
+
20160318110710
|
67
|
+
|
68
|
+
This timestamp is used to track installation of each migration script and insure correct apply/undo ordering.
|
69
|
+
|
70
|
+
# DynamoDbMigrationManager
|
71
|
+
This manager is called to apply/rollback migration script changes against a DynamoDb instance.
|
72
|
+
|
73
|
+
### #connect
|
74
|
+
This method is called to connect the manager to the DynamoDb instance. If the migration manager has never been connected to the instance then the 'dynamodb_migrations' table will be created to record migration script executions.
|
75
|
+
|
76
|
+
**Example**
|
77
|
+
|
78
|
+
manager = DynamoDbMigrationManager.new
|
79
|
+
manager.connect
|
80
|
+
|
81
|
+
### #apply
|
82
|
+
This method is called to execute any migration scripts (in chronological order) that have not been executed against the current DynamoDb instance.
|
83
|
+
|
84
|
+
**Example**
|
85
|
+
|
86
|
+
#apply any outstanding migration scripts
|
87
|
+
manager.apply
|
88
|
+
|
89
|
+
### #rollback
|
90
|
+
This method is called to rollback the last migration script that was executed against the current DynamoDb instance.
|
91
|
+
|
92
|
+
#rollback the last migration script
|
93
|
+
manager.rollback
|
94
|
+
|
95
|
+
# DynamoDbTableManager
|
96
|
+
|
97
|
+
This manager object provides the following methods for managing tables within a DynamoDb instance.
|
98
|
+
|
99
|
+
### #create
|
100
|
+
|
101
|
+
This method is called to create a table within DynamoDb.
|
102
|
+
|
103
|
+
**Params**
|
104
|
+
|
105
|
+
- **table_name** [String] [Required] This is used to specify the name of the table to create. (Must be unique within the DynamoDb instance).
|
106
|
+
- **attributes** [Hash] [Required] This is used to specify the attributes used by the keys and indexes. (Use the DynamoDbAttributesBuilder to create attributes)
|
107
|
+
- **partition_key** [Symbol] [Required] This is the document attribute that will be used as the partition key of this table.
|
108
|
+
- **range_key** [Symbol / nil] [Optional] This is the document attribute that will be used as the range key for this table.
|
109
|
+
- **read_capacity** [Number] [Default=20] This is the read throughput required for this table.
|
110
|
+
- **write_capacity** [Number] [Default=10] This is the write throughput required for this table.
|
111
|
+
- **global_indexes** [Array / nil] [Optional] This is an array of the global indexes to create for this table. (Use the ***#create_global_index*** method to create each global index required and populate an array for this parameter).
|
112
|
+
|
113
|
+
**Examples**
|
114
|
+
|
115
|
+
Table with partition key, no range key and no indexes:
|
116
|
+
|
117
|
+
#create an attribute builder
|
118
|
+
builder = DynamoDbAttributesBuilder.new
|
119
|
+
|
120
|
+
#set the partition key attribute
|
121
|
+
builder.add(:type, :S)
|
122
|
+
|
123
|
+
#create the table
|
124
|
+
manager.create('event_tracking', builder.attributes, :type)
|
125
|
+
|
126
|
+
Table with partition key, range key and no indexes:
|
127
|
+
|
128
|
+
#create an attribute builder
|
129
|
+
builder = DynamoDbAttributesBuilder.new
|
130
|
+
|
131
|
+
#set the partition key attribute
|
132
|
+
builder.add(:type, :S)
|
133
|
+
#set the range key attribute
|
134
|
+
builder.add(:timestamp, :S)
|
135
|
+
|
136
|
+
#create the table
|
137
|
+
manager.create('event_tracking', builder.attributes, :type, :timestamp)
|
138
|
+
|
139
|
+
Table with a global index:
|
140
|
+
|
141
|
+
#create an attribute builder
|
142
|
+
builder = DynamoDbAttributesBuilder.new
|
143
|
+
|
144
|
+
#set the partition key attribute
|
145
|
+
builder.add(:id, :S)
|
146
|
+
|
147
|
+
global_indexes = []
|
148
|
+
#create the global index
|
149
|
+
index = manager.create_global_index('type_index', :type)
|
150
|
+
#add the index to the global_indexes array
|
151
|
+
global_indexes.push(index)
|
152
|
+
|
153
|
+
#create the table and the index
|
154
|
+
manager.create('event_tracking', builder.attributes, :id, :nil, 20, 10, global_indexes)
|
155
|
+
|
156
|
+
### #drop
|
157
|
+
This method is called to drop a table.
|
158
|
+
|
159
|
+
> **WARNING**: *This will drop all data stored within the table*
|
160
|
+
|
161
|
+
**Params**
|
162
|
+
|
163
|
+
- **table_name** [String] [Required] This is the name of the table to drop.
|
164
|
+
|
165
|
+
**Example**
|
166
|
+
|
167
|
+
#drop the table
|
168
|
+
manager.drop('event_tracking')
|
169
|
+
|
170
|
+
### #exists?(table_name)
|
171
|
+
|
172
|
+
This method is called to check if a table exists within the database.
|
173
|
+
|
174
|
+
manager.exists?('event_tracking')
|
175
|
+
=> true
|
176
|
+
|
177
|
+
|
178
|
+
### #add_index
|
179
|
+
This method is called to add an index to an existing table.
|
180
|
+
|
181
|
+
**Params**
|
182
|
+
|
183
|
+
- **table_name** [String] [Required] This is the name of the index. (Must be unique within the scope of the table)
|
184
|
+
- **attributes** [Hash] [Required] This is the document attributes used by the table keys and index keys. (Use the DynamoDbAttributesBuilder to create the attributes hash.)
|
185
|
+
- **global_index** [Hash] [Required] This is the global index to add to the table. (Use the ***#create_global_index*** method to create the global index hash.)
|
186
|
+
|
187
|
+
**Example**
|
188
|
+
|
189
|
+
#build the attributes hash
|
190
|
+
builder = DynamoDbAttributesBuilder.new
|
191
|
+
#add the attribute for the tables partition key & range key (if range key required)
|
192
|
+
builder.add(:id, :S)
|
193
|
+
#add the attributes for the index partition key and range key (if required)
|
194
|
+
builder.add(:type, :S)
|
195
|
+
|
196
|
+
#create the index hash
|
197
|
+
index = manager.create_global_index('type_index', :type)
|
198
|
+
|
199
|
+
#add the index to the table
|
200
|
+
manager.add_index('event_tracking', builder.attributes, index)
|
201
|
+
|
202
|
+
|
203
|
+
### #drop_index
|
204
|
+
This method is called to drop an existing index from a table.
|
205
|
+
|
206
|
+
**Params**
|
207
|
+
|
208
|
+
- **table_name** [String] [Required] This is the name of the table you want to remove the index from.
|
209
|
+
- **index_name** [String] [Required] This is the name of the index you want to remove.
|
210
|
+
|
211
|
+
**Example**
|
212
|
+
|
213
|
+
#drop the index
|
214
|
+
manager.drop_index('event_tracking', 'type_index')
|
215
|
+
|
216
|
+
### #update_index_throughput
|
217
|
+
|
218
|
+
This method is called to update the throughput required by an index.
|
219
|
+
|
220
|
+
**Params**
|
221
|
+
|
222
|
+
- **table_name** [String] [Required] This is the name of the table the index belongs to.
|
223
|
+
- **index_name** [String] [Required] This is the name of the index to update.
|
224
|
+
- **read_capacity** [Number] [Required] This is the read throughput required per second.
|
225
|
+
- **write_capacity** [Number] [Required] This is the write throughput required per second.
|
226
|
+
|
227
|
+
**Example**
|
228
|
+
|
229
|
+
#update the index
|
230
|
+
manager.update_index_throughput('event_tracking', 'type_index', 50, 20)
|
231
|
+
|
232
|
+
### #has_index?(table_name, index_name)
|
233
|
+
|
234
|
+
This method is called to check if an index exists on a table within the database.
|
235
|
+
|
236
|
+
manager.has_index?('event_tracking', 'event_type')
|
237
|
+
=> true
|
238
|
+
|
239
|
+
|
240
|
+
# DynamoDbRepository
|
241
|
+
|
242
|
+
This is a base repository that exposes core functionality for interacting with a DynamoDb table. It is intended to be wrapped inside of a table specific repository, and is only provided to give a common way of interacting with a DynamoDb table.
|
243
|
+
|
244
|
+
Before calling any methods from the repository the **.table_name** attribute must be set so that the repository knows which table to run the operations against.
|
245
|
+
|
246
|
+
**Example**
|
247
|
+
|
248
|
+
repository.table_name = 'event_tracking'
|
249
|
+
|
250
|
+
### #put
|
251
|
+
This method is called to insert an item into a DynamoDb table.
|
252
|
+
|
253
|
+
**Params**
|
254
|
+
|
255
|
+
- **item** [Object] [Required] The document to store within the table.
|
256
|
+
|
257
|
+
**Example**
|
258
|
+
|
259
|
+
#add the document object to the table
|
260
|
+
repository.put(item)
|
261
|
+
|
262
|
+
### #delete
|
263
|
+
|
264
|
+
This method is called to delete a document from a DynamoDb table.
|
265
|
+
|
266
|
+
**Params**
|
267
|
+
|
268
|
+
- **keys** [Hash] [Required] This is a hash of the primary key of the document you want to delete. (The keys hash should contain the partition_key and if the table requires it the range_key.)
|
269
|
+
|
270
|
+
**Example**
|
271
|
+
|
272
|
+
#delete an item where the partition key (:id) is the primary key
|
273
|
+
repository.delete({ :id => '012' })
|
274
|
+
|
275
|
+
#delete an item where the partition key (:type) and the range key (:index) is the primary key
|
276
|
+
repository.delete({ :type => 'list', :index => 2 })
|
277
|
+
|
278
|
+
### #get_by_key
|
279
|
+
This method is called to get a single item from a table by its key.
|
280
|
+
|
281
|
+
**Params**
|
282
|
+
|
283
|
+
- **partition_key** [Symbol] [Required] This is the document attribute that is the partition key for the table.
|
284
|
+
- **partition_key_value** [String / Number] [Required] This is the value of the documents partition key.
|
285
|
+
- **range_key** [Symbol] [Optional] This is the document attribute that is the range key for the table.
|
286
|
+
- **range_key_value** [String / Number] [Optional] This is the value of the documents range key.
|
287
|
+
|
288
|
+
**Example**
|
289
|
+
|
290
|
+
#get an item where the partition key is the primary key
|
291
|
+
item = repository.get(:id, '12345')
|
292
|
+
|
293
|
+
#get an item where the partition key and the range key is the primary key
|
294
|
+
item = repository.get(:type, 'list', :index, 2)
|
295
|
+
|
296
|
+
|
297
|
+
### #all
|
298
|
+
This method is called to get all items from a table.
|
299
|
+
|
300
|
+
**Example**
|
301
|
+
|
302
|
+
|
303
|
+
#get all items from table
|
304
|
+
all_items_array = repository.all
|
305
|
+
|
306
|
+
### #scan
|
307
|
+
This method is called to execute a query against an entire table bypassing any indexes.
|
308
|
+
|
309
|
+
> **WARNING:** *Full table scans are slower than queries ran against a global index.*
|
310
|
+
|
311
|
+
**Params**
|
312
|
+
|
313
|
+
- **expression** [String] [Required] This is an expression string for that contains the filter expression to run against the full table scan.
|
314
|
+
- **expression_params** [Hash] [Required] This is a hash that contains the parameter names & values used by parameters within the scan expression.
|
315
|
+
- **limit** [Number] [Optional] This is used to specify a limit to the number of records returned by the scan query.
|
316
|
+
- **count** [Bool] [Optional] This is used to specify that the scan query should only return a count of the items that match the scan query.
|
317
|
+
|
318
|
+
**Example**
|
319
|
+
|
320
|
+
#scan the table and return matching items
|
321
|
+
results = repository.scan('#type = :type and #index > :index', { '#type' => :type, ':type' => 'list', '#index' => :index, ':index' => 2 })
|
322
|
+
|
323
|
+
#scan the table and return matching items limited to 5 results
|
324
|
+
results = repository.scan('#type = :type and #index > :index', { '#type' => :type, ':type' => 'list', '#index' => :index, ':index' => 2 }, 5)
|
325
|
+
|
326
|
+
#scan the table and return a count of matching items
|
327
|
+
count = repository.scan('#type = :type and #index > :index', { '#type' => :type, ':type' => 'list', '#index' => :index, ':index' => 2 }, nil, true)
|
328
|
+
|
329
|
+
> **Notes:**
|
330
|
+
> Attribute names should be specified using Expression parameter names which should start with a #
|
331
|
+
> Attribute values should be specified using Expression parameter values which should start with a :
|
332
|
+
|
333
|
+
|
334
|
+
### #query
|
335
|
+
This method is called to execute a query against either a table partition or an index.
|
336
|
+
|
337
|
+
**Params**
|
338
|
+
|
339
|
+
- **partition_key_name** [Symbol] [Required] This is used to specify the attribute that is used as the partition key for this table.
|
340
|
+
- **partition_key_value** [String / Number] [Required] This is used to specify the value of the partition to run this query against.
|
341
|
+
- **range_key_name** [Symbol] [Optional] This is used to specify the range key to run this query against if needed.
|
342
|
+
- **range_key_value** [String / Number] [Optional] This is used to specify the value of the range key to run this query against if needed.
|
343
|
+
- **expression** [String] [Required] This is an expression string used to specify the filter to run against the records found within the partition/range.
|
344
|
+
- **expression_params** [Hash] [Required] This is a hash that contains the parameter names & values used by parameters within the query expression.
|
345
|
+
- **index_name** [String] [Optional] This is the name of the index to run this query against.
|
346
|
+
- **limit** [Number] [Optional] This is used to specify a limit to the number of records returned by the query.
|
347
|
+
- **count** [Bool] [Optional] This is used to specify that the scan query should only return a count of the items that match the query.
|
348
|
+
|
349
|
+
**Examples**
|
350
|
+
|
351
|
+
Query from a table partition without an index:
|
352
|
+
|
353
|
+
results = repository.query(:name, 'name 1', nil, nil, '#number > :number', { '#number' => 'number', ':number' => 2})
|
354
|
+
|
355
|
+
Query and Count from a table partition without an index:
|
356
|
+
|
357
|
+
count = repository.query(:name, 'name 1', nil, nil, '#number > :number', { '#number' => 'number', ':number' => 2}, nil, nil, true)
|
358
|
+
|
359
|
+
Query from an index partition:
|
360
|
+
|
361
|
+
results = repository.query(:name, 'name 1', nil, nil, '#number > :number', { '#number' => 'number', ':number' => 2}, 'name_index')
|
362
|
+
|
26
363
|
|
27
364
|
## Development
|
28
365
|
|
@@ -32,10 +369,9 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
32
369
|
|
33
370
|
## Contributing
|
34
371
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
372
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/vaughanbrittonsage/dynamodb_framework. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
36
373
|
|
37
374
|
|
38
375
|
## License
|
39
376
|
|
40
|
-
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
41
|
-
|
377
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
@@ -22,22 +22,22 @@ class DynamoDbRepository
|
|
22
22
|
|
23
23
|
end
|
24
24
|
|
25
|
-
def delete(
|
25
|
+
def delete(keys)
|
26
26
|
|
27
27
|
params =
|
28
28
|
{
|
29
29
|
table_name: @table_name,
|
30
|
-
key:
|
30
|
+
key: keys
|
31
31
|
}
|
32
32
|
|
33
33
|
dynamodb.client.delete_item(params)
|
34
34
|
|
35
35
|
end
|
36
36
|
|
37
|
-
def get_by_key(
|
37
|
+
def get_by_key(partition_key, partition_value, range_key = nil, range_value = nil)
|
38
38
|
|
39
39
|
key = {}
|
40
|
-
key[
|
40
|
+
key[partition_key] = partition_value
|
41
41
|
if(range_key != nil)
|
42
42
|
key[range_key] = range_value
|
43
43
|
end
|
@@ -117,7 +117,7 @@ class DynamoDbRepository
|
|
117
117
|
|
118
118
|
end
|
119
119
|
|
120
|
-
def query(
|
120
|
+
def query(partition_key_name, partition_key_value, range_key_name = nil, range_key_value = nil, expression = nil, expression_params = nil, index_name = nil, limit = nil, count = false)
|
121
121
|
|
122
122
|
params = {
|
123
123
|
table_name: table_name
|
@@ -132,13 +132,13 @@ class DynamoDbRepository
|
|
132
132
|
end
|
133
133
|
|
134
134
|
if range_key_name != nil
|
135
|
-
params[:key_condition_expression] = '#
|
136
|
-
params[:expression_attribute_names] = { '#
|
137
|
-
params[:expression_attribute_values] = { ':
|
135
|
+
params[:key_condition_expression] = '#partition_key = :partition_key and #range_key = :range_key'
|
136
|
+
params[:expression_attribute_names] = { '#partition_key' => partition_key_name, '#range_key' => range_key_name }
|
137
|
+
params[:expression_attribute_values] = { ':partition_key' => partition_key_value, ':range_key' => range_key_value }
|
138
138
|
else
|
139
|
-
params[:key_condition_expression] = '#
|
140
|
-
params[:expression_attribute_names] = { '#
|
141
|
-
params[:expression_attribute_values] = { ':
|
139
|
+
params[:key_condition_expression] = '#partition_key = :partition_key'
|
140
|
+
params[:expression_attribute_names] = { '#partition_key' => partition_key_name }
|
141
|
+
params[:expression_attribute_values] = { ':partition_key' => partition_key_value }
|
142
142
|
end
|
143
143
|
|
144
144
|
if expression_params != nil
|