evanmiller/boss_db — pull request #110 by burbas (2013-06-24 11:31:08+00:00)
Title: Updates on the DynamoDB adapter

- The user can now set the endpoint via db_host (Eg. {db_host, "dynamodb.eu-west-1.amazonaws.com"}. If the field is missing it will use "dynamodb.us-east-1.amazonaws.com".

- Goes through all of the loaded applications and adds the belonging models to DynamoDB

- Global values for read/write capacity (See http://aws.amazon.com/dynamodb/faqs/#What_is_provisioned_throughput for more info) can be set in the configuration file:
```erlang
...
{db_read_capacity, X :: integer()},
{db_write_capacity, Y :: integer()},
...
```

- Add support for range-key (See http://aws.amazon.com/dynamodb/faqs/#What_kind_of_query_functionality_does_DynamoDB_support). Range key is specified as a field in the proplist returned by the function dynamodb_settings/0. This function is specified per model and enables the user to override the global config values of read/write capacity as well as defining range key.

```erlang
-module(my_model, [Id, Title :: string(), Created :: timestamp()]).
...
-spec dynamodb_settings() -> proplist.
dynamodb_settings() ->
[
{range_key, Created},
{db_read_capacity, X :: integer},
{db_write_capacity, Y :: integer)
].
```