Method: SimpleDeploy::AWS::SimpleDB#select

Defined in:
lib/simple_deploy/aws/simpledb.rb

#select(query) ⇒ Object



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/simple_deploy/aws/simpledb.rb', line 44

def select(query)
  options = { 'ConsistentRead' => true }
  data = {}
  next_token = nil

  while true
    options.merge! 'NextToken' => next_token
    chunk = with_retries(retry_options) do
      @connect.select(query, options).body
    end
    data.merge! chunk['Items']
    next_token = chunk['NextToken']
    break unless next_token
  end

  data
end