@lifeomic/dynamodb-dataloader
Advanced tools
Comparing version 0.0.5 to 1.0.0
{ | ||
"name": "@lifeomic/dynamodb-dataloader", | ||
"version": "0.0.5", | ||
"version": "1.0.0", | ||
"description": "A DataLoader that batches DynamoDB item lookups", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -1,3 +0,2 @@ | ||
dynamodb-dataloader | ||
=================== | ||
# dynamodb-dataloader | ||
@@ -8,2 +7,26 @@ [![npm](https://img.shields.io/npm/v/@lifeomic/dynamodb-dataloader.svg)](https://www.npmjs.com/package/@lifeomic/dynamodb-dataloader) | ||
A DataLoader that batches requests for DynamoDB | ||
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 | ||
```javascript | ||
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' } } | ||
}); | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
160828
1
32