0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
uses chef databags as a backend for the datamapper ORM
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

= 0.10.8
>= 0
= 1.2.0
 Project Readme

Chef Datamapper Adapter

This is an experimental adapter for datamapper to use chef databags as a backend datastore.

Setup

There are three configuration options needed when you initialize the adapter.

DataMapper.setup(:default,
  :adapter => 'chef',
  :node_name => 'mybox',                       #this needs to also match a client client
  :client_key => '/path/to/client/key.pem',    #this key ,ust match the client from above
  :chef_server_url => 'http://localhost:4000/' #url to the chef server api
)

Models

Models do not need a serial nor do they need to have keys set. This is all taken care of by the adapter with a single added line.

class Post
  include DataMapper::Resource

  property :title, String
  property :body, Text

  has n, :comments

  is :chef  #the secret sauce

end

DISCLAIMER

This code is experimental and has not been fully tested. Use at your own risk.

License

The code and documentation is distributed under the Apache 2 license (http://www.apache.org/licenses/LICENSE-2.0.html). Contributions back to the source are encouraged.