AWS DynamoDB ORM for Typescript
npm install @serverless-seoul/dynamorm


npm install @serverless-seoul/dynamorm
`How does it looks like?
`typescript
import {
Config,
Decorator,
Query,
Table,
} from "@serverless-seoul/dynamorm";@Decorator.Table({ name:
your_table_name_on_aws_dynamodb })
export class BlogPost extends Table {
@Decorator.HashPrimaryKey("id")
public static readonly primaryKey: Query.HashPrimaryKey; @Decorator.Attribute({ name: "id" })
public id: string!;
@Decorator.Attribute({ name: "title" })
public title: string!;
@Decorator.Attribute({ name: "body" })
public body: Array<
| { type: "text", text: string }
| { type: "image", url: string, width: number, height: number }
> = [];
@Decorator.Attribute()
public viewCount: number = 0;
@Decorator.Attribute()
public author: {
name: string;
profileImageURL: string;
}
}
`Dynamorm supports all dynamodb query / scan / update / delete interface, and...
- TimeToLive attribute
- DAX (DynamoDB Accelerator)
- Optimized aws-sdk usage (HTTP Connection reusing)
- AWS X-Ray
- Testing (Local DynamoDB) support
... and more!
Checkout Full Documents!
Testing
you need to run dynamodb locally in order to run unit tests
`
brew cask install docker
docker pull amazon/dynamodb-local
docker run --rm --name catch-dynamo -p 8000:8000 -d amazon/dynamodb-local
`
running test
`
DYNAMO_TYPES_ENDPOINT=http://127.0.0.1:8000 npm run test
``