# Introduction

`Tynamo` is decorator based data-mapper and ETL support library.  Internally uses [reflect-metadata](https://github.com/rbuckton/reflect-metadata). Since all API degins are similar to `AWS-SDK`, you can use them most easily if you are already familiar with AWS-SDK.

{% code title="cat.ts" %}

```typescript
@DynamoEntity()
class Cat {
    @DynamoProperty({ keyType: KeyType.hash })
    id!: number;

    @DynamoProperty({ keyType: KeyType.sort })
    age!: number;

    @DynamoProperty({ keyType: KeyType.attr })
    name!: string;

    constructor(id: number, age: number, name: string) {
        this.id = id;
        this.age = age;
        this.name = name;
    }
}
```

{% endcode %}

{% code title="putCat.ts" %}

```typescript
// Create connection.
const tynamo: Tynamo = new Tynamo({
    region: "ap-northeast-2",
    endpoint: "http://localhost:8000"
});

// get table.
const catTable: TynamoTable<Cat> = tynamo.getTableOf(Cat);

// CreateTable then, PutItem.
// It is smillar to DynamoDB.putItem()
catTable.createTable();
catTable.putItem({
    Item: new Cat(0, 0, "garfield"),
    ConditionExpression: "attribute_not_exists(#id)"
});
```

{% endcode %}
