Aws Sdb Proxy plugin
Plugin details
Documentation
ruby script/plugin install http://rug-b.rubyforge.org/svn/aws_sdb_proxy/
Setup and Usage
=================
1. Enter your Amazon Web Service credentials in the config/aws_sdb_proxy.yml config file (optionally configure server ports and a salt used to hash primary keys from the record content).
2. Check your available SimpleDB domains with rake aws_sdb:list_domains and create a new one with rake aws_sdb:create_domain DOMAIN=my_new_domain if necessary.
3. Start the AwsSdbProxy server with rake aws_sdb:start_proxy_in_foreground. (Once things are configured correctly you can also use rake aws_sdb:start_proxy to start the server as a background daemon.)
4. Connect any ActiveResource model to your SimpleDB domain, e.g.
class Post < ActiveResource::Base
self.site = "http://localhost:8888" # AwsSdbProxy host + port
self.prefix = "/my_new_domain/" # use your SimpleDB domain enclosed in /s
end
5. Use your model just like any ActiveResource model in your application or try it in script/console, e.g.
>> p = Post.create(:title => 'My first SimpleDB post')
=> #
Sun Jan 20 00:42:43 UTC 2008, "title"=>"My first SimpleDB post",
"id"=>1081408...01005954, "created_at"=>Sun Jan 20 00:42:43 UTC 2008}>
>> p.body = 'Content is king'
=> "Content is king"
>> p.save
=> true
>> Post.find(:first, :params => { :title => 'My first SimpleDB post' })
=> #
Sun Jan 20 00:45:28 UTC 2008, "title"=>"My first SimpleDB post",
"body"=>"Content is king", "id"=>1081408...01005954, "created_at"=>
Sun Jan 20 00:42:43 UTC 2008}>
Further Documentation
There is currently no advanced documentation for this plugin.
New documentationEdit plugin | Back in time (2 older versions) | Last edited by: scott, 2 months ago

