@xapp/stentor-service-dynamo
v1.86.12
Published
PLACEHOLDER DESCRIPTION OF PACKAGE
Readme
@xapp/stentor-service-dynamo
The base DynamoDB service used by the other @xapp/stentor-service-* packages. It exports an abstract DynamoService class that wraps the AWS SDK v3 DynamoDBDocumentClient (via @aws-sdk/lib-dynamodb) with retry/backoff logic for creates, batch writes, gets, queries, scans, updates and deletes. It also exports the scan() and withCondition() query builders for composing FilterExpression/ConditionExpression objects, and a StubDocumentClient that replaces the write client when preventWrites: true is set.
Usage
import { DynamoService, DynamoServiceProps } from "@xapp/stentor-service-dynamo";
class MyService extends DynamoService {
constructor(props: DynamoServiceProps) {
super(props); // props.tableName is required
}
}Consumers only need to supply a tableName (and optionally readDb/writeDb clients, retryAttempts, waitMs, or preventWrites); the read/write DynamoDBDocumentClient instances are otherwise created automatically using the AWS SDK's default credential chain.
