1.0.10 • Published 3 years ago

@anabode/dynamodb_service v1.0.10

Weekly downloads
-
License
WTFPL
Repository
-
Last release
3 years ago

Anabode

N|Solid

Service Layer Abstraction for DynamoDB CRUD operations

Current Iteration

Uses DynamoDBDocClient SDK for easier object mapping

Recommending that one always uses ConditionalExpression to check for update/delete constraints.

This library will not do that for you, it is up to your model implementation to do that

Current Methods

  • Get
    • Can be used for any non Anabode business logic related CRUD operation
  • Query
  • Delete
  • Update (Uses PutItem)
  • UpdateInPlace (uses PutItem)

Usage Tips

var modelRequest = {
                        TableName: "",
                        Key: {
                           ["primaryKeyName"]: "",
                           //["rangeKey"]: ""

                        }
                    }
var conf = {aws: {region: "", accessKeyId:"", secretAccessKey:""}}

var srv = new (require('@anabode/dynamodb_service'))(conf);

/// inside a function with callback or promise 
srv.getItem(modelRequest, (e,d) => {
    return callback(e,d);
})

if no callback is passed than a promise is returned

srv.queryItem(modelRequest)
    .then((data) => {
        return data
    })
    .catch((err) => {
        return err
    })

Todos

  • Write MORE Tests
  • More Tyding up is needed

License

WTFPL

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago