Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
DataMapper adapter for Riak
Tag: 0.0.2

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
spec
Gemfile
README.md
dm-riak-adapter.gemspec

README.md

dm-riak-adapter

DataMapper adapter for the Dynamo-inspired key/value store, Riak.

Install

Requires that you have Riak installed. You can download the latest release here, or install using homebrew:

  brew install riak

Install the dm-riak-adapter gem:

  gem install dm-riak-adapter

Usage

Require dm-core and dm-riak-adapter. Tell DataMapper to use the Riak adapter and set a namespace for your app. This namespace will prefix each bucket like the following. myapp:projects myapp:tasks

  require 'dm-core'
  require 'dm-riak-adapter'

  DataMapper.setup :default, :adapter => 'riak', :namespace => 'myapp'

Continue Defining your models and properties as you normally would.

  class Project
    include DataMapper::Resource

    property :id,   Serial
    property :name, String

    has n, :tasks
  end

  class Task
    include DataMapper::Resource

    property :id,       Serial
    property :summary,  String

    belongs_to :project
  end
Something went wrong with that request. Please try again.