ddbcli 0.4.2.beta2 → 0.5.0.beta

Sign up to get free protection for your applications and to get access to all the features.
@@ -67,26 +67,39 @@ rule
67
67
  val[1]
68
68
  }
69
69
 
70
- alter_stmt : ALTER TABLE IDENTIFIER capacity_clause
71
- {
72
- struct(:ALTER_TABLE, :table => val[2], :index_name => nil, :capacity => val[3], :stream => nil)
73
- }
74
- | ALTER TABLE IDENTIFIER stream_clause
75
- {
76
- struct(:ALTER_TABLE, :table => val[2], :index_name => nil, :capacity => nil, :stream => val[3])
77
- }
78
- | ALTER TABLE IDENTIFIER capacity_clause stream_clause
79
- {
80
- struct(:ALTER_TABLE, :table => val[2], :index_name => nil, :capacity => val[3], :stream => val[4])
81
- }
82
- | ALTER TABLE IDENTIFIER stream_clause capacity_clause
83
- {
84
- struct(:ALTER_TABLE, :table => val[2], :index_name => nil, :capacity => val[4], :stream => val[3])
85
- }
86
- | ALTER TABLE IDENTIFIER CHANGE INDEX IDENTIFIER capacity_clause
87
- {
88
- struct(:ALTER_TABLE, :table => val[2], :index_name => val[5], :capacity => val[6])
89
- }
70
+ alter_stmt : alter_table_stmt
71
+ | alter_table_index_stmt
72
+
73
+
74
+ alter_table_stmt :ALTER TABLE IDENTIFIER capacity_clause
75
+ {
76
+ struct(:ALTER_TABLE, :table => val[2], :capacity => val[3], :stream => nil)
77
+ }
78
+ | ALTER TABLE IDENTIFIER stream_clause
79
+ {
80
+ struct(:ALTER_TABLE, :table => val[2], :capacity => nil, :stream => val[3])
81
+ }
82
+ | ALTER TABLE IDENTIFIER capacity_clause stream_clause
83
+ {
84
+ struct(:ALTER_TABLE, :table => val[2], :capacity => val[3], :stream => val[4])
85
+ }
86
+ | ALTER TABLE IDENTIFIER stream_clause capacity_clause
87
+ {
88
+ struct(:ALTER_TABLE, :table => val[2], :capacity => val[4], :stream => val[3])
89
+ }
90
+
91
+ alter_table_index_stmt : ALTER TABLE IDENTIFIER CHANGE GLOBAL INDEX IDENTIFIER capacity_clause
92
+ {
93
+ struct(:ALTER_TABLE_INDEX, :table => val[2], :action => 'Update', :index_definition => {:name => val[6], :capacity => val[7]})
94
+ }
95
+ | ALTER TABLE IDENTIFIER ADD global_index_definition_with_capacity
96
+ {
97
+ struct(:ALTER_TABLE_INDEX, :table => val[2], :action => 'Create', :index_definition => val[4])
98
+ }
99
+ | ALTER TABLE IDENTIFIER DROP GLOBAL INDEX IDENTIFIER
100
+ {
101
+ struct(:ALTER_TABLE_INDEX, :table => val[2], :action => 'Delete', :index_definition => {:name => val[6]})
102
+ }
90
103
 
91
104
  use_stmt : USE IDENTIFIER
92
105
  {
@@ -200,18 +213,26 @@ rule
200
213
  val[0] + [val[2]]
201
214
  }
202
215
 
203
- index_definition : INDEX IDENTIFIER '(' IDENTIFIER attr_type_list ')' index_type_definition
204
- {
205
- {:name => val[1], :key => val[3], :type => val[4], :projection => val[6]}
206
- }
207
- | GLOBAL INDEX IDENTIFIER '(' global_index_keys ')' index_type_definition
208
- {
209
- {:name => val[2], :keys => val[4], :projection => val[6], :global => true}
210
- }
211
- | GLOBAL INDEX IDENTIFIER '(' global_index_keys ')' index_type_definition strict_capacity_clause
212
- {
213
- {:name => val[2], :keys => val[4], :projection => val[6], :capacity => val[7], :global => true}
214
- }
216
+ index_definition : locat_index_definition
217
+ | global_index_definition
218
+
219
+ locat_index_definition : INDEX IDENTIFIER '(' IDENTIFIER attr_type_list ')' index_type_definition
220
+ {
221
+ {:name => val[1], :key => val[3], :type => val[4], :projection => val[6]}
222
+ }
223
+
224
+ global_index_definition : global_index_definition_without_capacity
225
+ | global_index_definition_with_capacity
226
+
227
+ global_index_definition_without_capacity : GLOBAL INDEX IDENTIFIER '(' global_index_keys ')' index_type_definition
228
+ {
229
+ {:name => val[2], :keys => val[4], :projection => val[6], :global => true}
230
+ }
231
+
232
+ global_index_definition_with_capacity : GLOBAL INDEX IDENTIFIER '(' global_index_keys ')' index_type_definition strict_capacity_clause
233
+ {
234
+ {:name => val[2], :keys => val[4], :projection => val[6], :capacity => val[7], :global => true}
235
+ }
215
236
 
216
237
  global_index_keys : IDENTIFIER attr_type_list
217
238
  {
@@ -1,3 +1,3 @@
1
1
  module DynamoDB
2
- VERSION = "0.4.2.beta2"
2
+ VERSION = "0.5.0.beta"
3
3
  end
data/spec/ddbcli_spec.rb CHANGED
@@ -34,7 +34,9 @@ describe 'ddbcli' do
34
34
  "KeySchema"=>[{"AttributeName"=>"id", "KeyType"=>"HASH"}],
35
35
  "TableStatus"=>"ACTIVE",
36
36
  "ProvisionedThroughput"=>
37
- {"NumberOfDecreasesToday"=>0,
37
+ {"LastIncreaseDateTime"=>0.0,
38
+ "LastDecreaseDateTime"=>0.0,
39
+ "NumberOfDecreasesToday"=>0,
38
40
  "ReadCapacityUnits"=>2,
39
41
  "WriteCapacityUnits"=>2},
40
42
  "TableSizeBytes"=>0,
@@ -64,7 +66,9 @@ describe 'ddbcli' do
64
66
  {"AttributeName"=>"val", "KeyType"=>"RANGE"}],
65
67
  "TableStatus"=>"ACTIVE",
66
68
  "ProvisionedThroughput"=>
67
- {"NumberOfDecreasesToday"=>0,
69
+ {"LastIncreaseDateTime"=>0.0,
70
+ "LastDecreaseDateTime"=>0.0,
71
+ "NumberOfDecreasesToday"=>0,
68
72
  "ReadCapacityUnits"=>2,
69
73
  "WriteCapacityUnits"=>2},
70
74
  "TableSizeBytes"=>0,
@@ -96,7 +100,9 @@ describe 'ddbcli' do
96
100
  {"AttributeName"=>"val", "KeyType"=>"RANGE"}],
97
101
  "TableStatus"=>"ACTIVE",
98
102
  "ProvisionedThroughput"=>
99
- {"NumberOfDecreasesToday"=>0,
103
+ {"LastIncreaseDateTime"=>0.0,
104
+ "LastDecreaseDateTime"=>0.0,
105
+ "NumberOfDecreasesToday"=>0,
100
106
  "ReadCapacityUnits"=>2,
101
107
  "WriteCapacityUnits"=>2},
102
108
  "TableSizeBytes"=>0,
@@ -136,7 +142,9 @@ describe 'ddbcli' do
136
142
  {"AttributeName"=>"val", "KeyType"=>"RANGE"}],
137
143
  "TableStatus"=>"ACTIVE",
138
144
  "ProvisionedThroughput"=>
139
- {"NumberOfDecreasesToday"=>0,
145
+ {"LastIncreaseDateTime"=>0.0,
146
+ "LastDecreaseDateTime"=>0.0,
147
+ "NumberOfDecreasesToday"=>0,
140
148
  "ReadCapacityUnits"=>2,
141
149
  "WriteCapacityUnits"=>2},
142
150
  "TableSizeBytes"=>0,
@@ -178,7 +186,9 @@ describe 'ddbcli' do
178
186
  {"AttributeName"=>"val", "KeyType"=>"RANGE"}],
179
187
  "TableStatus"=>"ACTIVE",
180
188
  "ProvisionedThroughput"=>
181
- {"NumberOfDecreasesToday"=>0,
189
+ {"LastIncreaseDateTime"=>0.0,
190
+ "LastDecreaseDateTime"=>0.0,
191
+ "NumberOfDecreasesToday"=>0,
182
192
  "ReadCapacityUnits"=>4,
183
193
  "WriteCapacityUnits"=>4},
184
194
  "TableSizeBytes"=>0,
@@ -220,7 +230,9 @@ describe 'ddbcli' do
220
230
  {"AttributeName"=>"val", "KeyType"=>"RANGE"}],
221
231
  "TableStatus"=>"ACTIVE",
222
232
  "ProvisionedThroughput"=>
223
- {"NumberOfDecreasesToday"=>0,
233
+ {"LastIncreaseDateTime"=>0.0,
234
+ "LastDecreaseDateTime"=>0.0,
235
+ "NumberOfDecreasesToday"=>0,
224
236
  "ReadCapacityUnits"=>2,
225
237
  "WriteCapacityUnits"=>2},
226
238
  "TableSizeBytes"=>0,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ddbcli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2.beta2
4
+ version: 0.5.0.beta
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Sugawara
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-22 00:00:00.000000000 Z
11
+ date: 2015-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json