lib/sdbport/aws/simpledb.rb in sdbport-0.3.0 vs lib/sdbport/aws/simpledb.rb in sdbport-0.4.0

- old
+ new

@@ -33,9 +33,20 @@ next_token = chunk['NextToken'] return data unless next_token end end + def select_and_store_chunk_of_tokens(query, options = {}) + options.merge! 'NextToken' => @token_for_next_chunk + chunk = sdb.select(query, options).body + @token_for_next_chunk = chunk['NextToken'] + return chunk['Items'] + end + + def more_chunks? + @token_for_next_chunk != nil + end + def count(domain) body = sdb.select("SELECT count(*) FROM `#{domain}`").body body['Items']['Domain']['Count'].first.to_i end