1.2.15 • Published 26 days ago

@alphax/dynamodb v1.2.15

Weekly downloads
-
License
MIT
Repository
github
Last release
26 days ago

DynamoDB Helper

Installation

yarn add @alphax/dynamodb
or
npm i @alphax/dynamodb

Feature

  • 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

NameDescription
scanScan items promise
scanRequestScan item request
queryQuery item promise
queryRequestQuery item request
getGet item promise
getRequestGet item request
putPut item promise
putRequestPut item request
updateUpdate item promise
updateRequestUpdate item request
deleteDelete item promise
deleteRequestDelete item request
truncateAlltruncate all records
truncatetruncate records with inputs
bulkInsert all records
1.2.14

26 days ago

1.2.15

26 days ago

1.2.12

1 year ago

1.2.13

1 year ago

1.2.11

1 year ago

1.2.0

1 year ago

1.2.8

1 year ago

1.2.7

1 year ago

1.2.6

1 year ago

1.2.5

1 year ago

1.2.4

1 year ago

1.2.3

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.2.9

1 year ago

1.2.10

1 year ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago