Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Tree: 90ede0b49c
Fetching contributors…

Cannot retrieve contributors at this time

81 lines (56 sloc) 3.061 kB


Fun little ruby client for Amazon DynamoDB.

# hash-key based tables
rdy ="your_table", [:your_hash_key, :string])
rdy.any_attribute = "nice!" = "bar""1") # set your hash key value
# # if ommitted the hash key value is generated = "bar2" # update

rdy.any_attribute = nil # delete an attribute

rdy.find("1") # find by hash key value / sets values to current instance
rdy_instance = Rdy.find("your_table", [:id, :string, 'mykey1']) # returns new Rdy instance

rdy.destroy # delete item


rdy.scan(:any_attribute => 'nice!')
limit = 10
rdy.scan(:any_attribute => 'nice!', limit)

# hash & range-key based tables
rdy2 ="your_table", [:your_hash_key, :string], [:your_range_key, :number])
rdy2.your_range_key = 1'mykey1') # or just

rdy2.find('mykey1', 1) # sets item values to current instance
rdy_instance = Rdy.find("your_table", [:your_hash_key, :string, 'mykey1'], [:your_range_key, :number, 1]) # returns new Rdy instance

rdy2.query(:hash_value => 'mykey1', :range_value => 1)

read_capacity_units = 10
write_capacity_units = 5
Rdy.create_table("rdy", read_capacity_units, write_capacity_units, :id => :string) # hash key only
Rdy.create_table("rdy2", read_capacity_units, write_capacity_units, {:id => :string}, {:comment_id => :number}) # hash and range key

# You can also create your own class
class User < RdyItem
    def initialize(hash_key, range_key) # this will save data to the 'users' table
        super(hash_key, range_key)

user =[:your_hash_key, :string], [:your_range_key, :number])


gem install rdy

Create a .rdy.yml file with your AWS credentials in your home directory. Checkout the sample file for help. Also make sure you activate DynamoDB in your AWS account.


rake test

On the initial run the tables are created. This may take a while, so it's possible the first run of the tests is going to fail. You can also create the tables manually if you want to avoid this. Check out the helper.rb class.

Contributing to rdy

  • Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
  • Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
  • Fork the project
  • Start a feature/bugfix branch
  • Commit and push until you are happy with your contribution
  • Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.


Copyright (c) 2012 Oliver Kiessler. See LICENSE.txt for further details.

Jump to Line
Something went wrong with that request. Please try again.