Sha256: 894110a5ec39062f3b000996ba1a505ef6cd8983c1598b225dfa5ac42ee2bd6c

Contents?: true

Size: 1.54 KB

Versions: 3

Compression:

Stored size: 1.54 KB

Contents

= dm-mnesia

A DataMapper adapter for Erlang's Mnesia db

==Requirements
  
You will need to install Rbridge[http://github.com/grockit/rulang].

==Installation
  
  sudo gem install dm-mnesia

==Usage

Require the gem in your enviroment file
  config.gem "dm-mnesia"
Initialize a connection using the adapter 
  connection = { :adapter => 'Mnesia',
                      :hostname => 'localhost',
                      :port => 9900,
                      :ids_table => 'NAME OF THE TABLE TO STORE UNIQUE IDS.',
                      :id_function=> 'NAME OF AN ERLANG FUNCTION TO CREATE UNIQUE IDS FOR YOUR RECORDS'}
      DataMapper.setup(:default, connection )
  
We used this[http://dudefrommangalore.blogspot.com/2009/03/auto-increment-in-mnesia-database.html] example for the ids_table option </p>

Now you can define your models just like you would if you were using the DataMapper default adapters. All CRUD operations work the same as well.

==Issues  

When using a BinaryString type as a key for your model, you must set it to ":require=>false", otherwise it won't work
When using a List type, you must assign the value to the column like so:
  Model.mycolumn = ["value", "value"]
 

==To Do List

In certain cases, the read command retrieves all record from Mnesia and filters, sorts them in ruby, more work needs to be done make this more efficient. This won't be a problem if you are working with records around 2000.  
Add missing Erlang types: Tuple, Atom.

Authors: Chad DePue (mailto:chad@inakanetworks.com), Manuel Gómez (manuel@inakanetworks.com)





Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
dm-mnesia-0.2.10 README.rdoc
dm-mnesia-0.2.9 README.rdoc
dm-mnesia-0.2.8 README.rdoc