0.0
No commit activity in last 3 years
No release in over 3 years
Amazon DynamoDB adapter for Lotus::Model
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.5
~> 0.67
~> 10

Runtime

~> 1.0
>= 0.1.1, ~> 0.1
~> 1.10
 Project Readme

Lotus::Model DynamoDB Adapter

An adapter is a concrete implementation of persistence logic for a specific database.

-- jodosha, Lotus::Model

This adapter implements persistence layer for a Amazon DynamoDB, and it pretends to be a really sane solution to fully experience DynamoDB advantages with Ruby.

It is built using AWS::DynamoDB::Client, which is a part of aws-sdk gem and implements latest version of DynamoDB protocol.

Status

Gem Version Build Status Coverage Status Code Climate Inline docs Dependencies

Links

Installation

Add this line to your application's Gemfile:

gem 'lotus-dynamodb'

And then execute:

$ bundle

Or install it yourself as:

$ gem install lotus-dynamodb

Usage

Please refer to Lotus::Model docs for any details related to Entity, Repository, Data Mapper and Adapter.

Data types

This adapter supports coercion to all DynamoDB types, including blobs and sets.

List of Ruby types that are supported:

  • AWS::DynamoDB::Binary – B
  • Array – S (via MultiJson)
  • Boolean – N (1 for true and 0 for false)
  • Date – N (Integer, seconds since Epoch)
  • DateTime – N (Float, seconds since Epoch)
  • Float – N
  • Hash – S (via MultiJson)
  • Integer – N
  • Set – SS, NS, BS (Set of String, Number or AWS::DynamoDB::Binary)
  • String – S
  • Time – N (Float, seconds since Epoch)

Repository methods

See complete list of Repository methods provided by Lotus::Model.

Following methods are not supported since it's incompatible with DynamoDB:

  • first
  • last

Query methods

Generic methods supported by DynamoDB adapter:

DynamoDB-specific methods:

Example

Check out the simple example in examples/purchase.rb.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request