Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
frankfarrell authored Aug 22, 2018
1 parent b46ca16 commit 4622fcc
Showing 1 changed file with 39 additions and 40 deletions.
79 changes: 39 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,50 @@
[![Build Status](https://travis-ci.org/frankfarrell/dynamodb-utils.svg?branch=master)](https://travis-ci.org/frankfarrell/dynamodb-utils)
[![](https://jitpack.io/v/frankfarrell/dynamodb-utils.svg)](https://jitpack.io/#frankfarrell/dynamodb-utils)

A kotlin library with utility function for dynamdb
Kotlin library with utility functions for AWS DynamDB. Run queries with the DSL, clone a table and do batch writes with exponential backoff.

## Get it

The easiest thing is to use [jitpack](jitpack.io). Add this to your gradle file
```

```groovy
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
dependencies {
implementation 'com.github.frankfarrell:dynamodb-utils:v0.0.1'
}
jcenter()
maven { url "https://jitpack.io" }
}
dependencies {
implementation 'com.github.frankfarrell:dynamodb-utils:v0.0.1'
}
```

## Dynamo DSL (Work in Progess)
A kotlin internal DSL for Query, Scan and Update operations on Dynamo

```kotlin

var result = DynamoDSL().query("mytable") {
hashKey("myHashKey") {
eq("abcd")
}
sortKey("mysortkey"){
between ( 2 AND 3)
}
filtering {
attribute("age") {
eq(44)
} and attributeExists("name") or {
attribute("nested"){
eq("x")
} and attributeExists("movie"){
eq("y")
}
}
}
}

while(result.hasNext()){
println(result.next());
}
```

## DynamoBatchExecutor
Expand Down Expand Up @@ -48,10 +79,8 @@ val dyanmoBatch: DynamoBatchExecutor<Person> = DynamoBatchExecutor<Person> (amaz

dynamoBatch.persist(listOf(Person("bob", "France"), Person("jack", "Dublin")), PersonMapper(), "targetTable")


```


## DynamoTableCloner

This library allows you to clone a dynamo table, including hash and sort key,local and secondary indexes, provisioned throughput settings, dynamo streaming even source mappings and autoscaling properties if defined.
Expand All @@ -72,33 +101,3 @@ dynamoTableCloner.cloneTable("template", "target")

// You now have a new table called "target"
```

## Dynamo DSL (Work in Progess)
A kotlin internal DSL for Query, Scan and Update operations on Dynamo

```kotlin

var result = DynamoDSL().query("mytable") {
hashKey("myHashKey") {
eq("abcd")
}
sortKey("mysortkey"){
between ( 2 AND 3)
}
filtering {
attribute("age") {
eq(44)
} and attributeExists("name") or {
attribute("nested"){
eq("x")
} and attributeExists("movie"){
eq("y")
}
}
}
}

while(result.hasNext()){
println(result.next());
}
```

0 comments on commit 4622fcc

Please sign in to comment.