1.2.16 • Published 1 year ago
@alphax/dynamodb v1.2.16
DynamoDB Helper
Installation
yarn add @alphax/dynamodb
or
npm i @alphax/dynamodbFeature
- Bulk Insert and Trancate
- Easy implement for database query
- Query Logging with log4js
- Option to tracing with AWS X-Ray
- CLI commands
Usage
import { DynamodbHelper } from '@alphax/dynamodb';
const helper = new DynamodbHelper({
logger: {
appenders: { console: { type: 'console' } },
categories: { default: { appenders: ['console'], level: 'info' } },
},
options: {
endpoint: 'http://localhost:8001',
region: 'ap-northeast-1',
},
});
(async () => {
const tableName = 'TableName';
// scan
const results = await helper.scan({
TableName: tableName,
});
// truncateAll
await helper.truncateAll(tableName);
// if exists
if (results.Items) {
// bulk insert
await helper.bulk(tableName, results.Items);
}
})();Methods
| Name | Description |
|---|---|
| scan | Scan items promise |
| scanRequest | Scan item request |
| query | Query item promise |
| queryRequest | Query item request |
| get | Get item promise |
| getRequest | Get item request |
| put | Put item promise |
| putRequest | Put item request |
| update | Update item promise |
| updateRequest | Update item request |
| delete | Delete item promise |
| deleteRequest | Delete item request |
| truncateAll | truncate all records |
| truncate | truncate records with inputs |
| bulk | Insert all records |
1.2.16
1 year ago
1.2.14
2 years ago
1.2.15
2 years ago
1.2.12
3 years ago
1.2.13
3 years ago
1.2.11
3 years ago
1.2.0
3 years ago
1.2.8
3 years ago
1.2.7
3 years ago
1.2.6
3 years ago
1.2.5
3 years ago
1.2.4
3 years ago
1.2.3
3 years ago
1.2.2
3 years ago
1.2.1
3 years ago
1.2.9
3 years ago
1.2.10
3 years ago
1.1.3
4 years ago
1.1.2
4 years ago
1.1.1
4 years ago
1.1.0
4 years ago
1.0.9
4 years ago
1.0.8
4 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