1.0.2 • Published 5 years ago

@lifeomic/dynamodb-dataloader v1.0.2

Weekly downloads
368
License
MIT
Repository
github
Last release
5 years ago

dynamodb-dataloader

npm Build Status Greenkeeper badge

A DataLoader that batches requests for DynamoDB. The DataLoader can fetch items from multiple tables at once so you should only need one instance per request.

You should be able to replace your calls to dynamoClient.get with loader.load and automaticly switch your network calls from GetItem to BatchGetItem.

NOTE: Make sure you update your IAM policy to allow dynamodb:BatchGetItem if you have strict IAM policies

Example code

const { createDataLoader } = require('@lifeomic/dynamodb-dataloader');

// Once per request or scope that can share data access
const client = new AWS.DyanmoDB();
const loader = createDataLoader({ client });

// Once per item fetch
const item = await loader.load({
  table: 'your table name',
  key: { idAattribute: { S: 'some id' } }
});
1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago