dynamodb-api 0.3.3 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c55c5bee72292279c0bd8971f8c0482b284f254a2c2148c1ab749be54acea2a2
4
- data.tar.gz: eb1456697a712eecdaa28d044053f7f978311922e7a42344e0e98bedfbc8a3e4
3
+ metadata.gz: cd5e78de7acd36a9196ea3945ce66a12e7b98c66485847b3f5727d04a044f783
4
+ data.tar.gz: 05450b5257f17ef9e3dd6d4e9ec523652dd8747c11df1859b5c3c93fd29fbf19
5
5
  SHA512:
6
- metadata.gz: 3909d6062659de0d273184ecfd2e152f516bec7ba6c1bb20a2fc248bb226ccb17ff101d1ceefbea1a0db104bc04a12bbd1aa41467482fc575439e3e4c27f8f4d
7
- data.tar.gz: 8ef953db6c060e6999951de14d4b4bd9ef293c2f4655db4ec48392d8c57e3255cbccd58a0f3d81a19cece40c3fbe269891f57233c46ac95e005a9e751fcacb1a
6
+ metadata.gz: 14d765ffb21e1140e51f6e27046a0da0da877969c0bdd9d6668eb568bfc114f918159ecbf88ad51532d02bded873019fd018f4a1cdee081d9f7ece3ffe9e8e5e
7
+ data.tar.gz: cc76aa8ffe6e9422b9c53832bf723536abcb28aa07ed018f98a23f73a10cd7780950527986fa9d81070a8b89746df4357dbf5c53704beed46d0bf0f368ad4c3b
data/.pryrc ADDED
@@ -0,0 +1,7 @@
1
+ if defined?(PryByebug)
2
+ Pry.commands.alias_command '_c', 'continue'
3
+ Pry.commands.alias_command '_s', 'step'
4
+ Pry.commands.alias_command '_n', 'next'
5
+ Pry.commands.alias_command '_f', 'finish'
6
+ Pry.commands.alias_command '_w', 'whereami'
7
+ end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dynamodb-api (0.3.3)
4
+ dynamodb-api (0.4.0)
5
5
  activesupport (>= 4)
6
6
  aws-sdk (~> 2)
7
7
 
@@ -13,10 +13,11 @@ require 'dynamodb/api/relation/order_clause'
13
13
  require 'dynamodb/api/relation/where_clause'
14
14
  require 'dynamodb/api/relation/filter_clause'
15
15
  require 'dynamodb/api/relation/global_secondary_index'
16
+ require 'dynamodb/api/relation/expression_attribute_names'
16
17
 
17
18
  module Dynamodb
18
- module Api
19
- extend self
19
+ module Api # :nodoc:
20
+ module_function
20
21
 
21
22
  def config
22
23
  block_given? ? yield(Dynamodb::Api::Config) : Dynamodb::Api::Config
@@ -1,6 +1,6 @@
1
1
  module Dynamodb
2
2
  module Api
3
- class Adapter
3
+ class Adapter # :nodoc:
4
4
  attr_reader :client
5
5
 
6
6
  def initialize
@@ -19,13 +19,17 @@ module Dynamodb
19
19
  private
20
20
 
21
21
  def build_query
22
- {
22
+ build_params = {
23
23
  table_name: from_clause.name,
24
24
  index_name: index_clause.name,
25
25
  select: select_clause.name,
26
26
  scan_index_forward: order_clause.direct,
27
27
  key_conditions: where_clause.key_conditions
28
28
  }.merge(build_filter_clause)
29
+ if expression_attribute&.names
30
+ build_params[:expression_attribute_names] = expression_attribute.names
31
+ end
32
+ build_params
29
33
  end
30
34
 
31
35
  def build_filter_clause
@@ -12,6 +12,7 @@ module Dynamodb
12
12
  attr_accessor :order_clause
13
13
  attr_accessor :where_clause
14
14
  attr_accessor :filter_clause
15
+ attr_accessor :expression_attribute
15
16
  end
16
17
  end
17
18
  end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dynamodb
4
+ module Api
5
+ module Relation
6
+ class ExpressionAttributeNames
7
+ attr_reader :names
8
+
9
+ def initialize(names)
10
+ @names = names
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
16
+
@@ -32,6 +32,11 @@ module Dynamodb
32
32
  self.filter_clause = Relation::FilterClause.new(expression, values)
33
33
  self
34
34
  end
35
+
36
+ def ex_attr(names)
37
+ self.expression_attribute = Relation::ExpressionAttributeNames.new(names)
38
+ self
39
+ end
35
40
  end
36
41
  end
37
42
  end
@@ -1,5 +1,5 @@
1
1
  module Dynamodb
2
2
  module Api
3
- VERSION = '0.3.3'.freeze
3
+ VERSION = '0.4.0'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynamodb-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - WalkerSumida
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-07-24 00:00:00.000000000 Z
11
+ date: 2018-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk
@@ -102,6 +102,7 @@ extensions: []
102
102
  extra_rdoc_files: []
103
103
  files:
104
104
  - ".gitignore"
105
+ - ".pryrc"
105
106
  - ".rspec"
106
107
  - ".travis.yml"
107
108
  - CODE_OF_CONDUCT.md
@@ -119,6 +120,7 @@ files:
119
120
  - lib/dynamodb/api/config/options.rb
120
121
  - lib/dynamodb/api/query.rb
121
122
  - lib/dynamodb/api/relation.rb
123
+ - lib/dynamodb/api/relation/expression_attribute_names.rb
122
124
  - lib/dynamodb/api/relation/filter_clause.rb
123
125
  - lib/dynamodb/api/relation/from_clause.rb
124
126
  - lib/dynamodb/api/relation/global_secondary_index.rb