Skip to content

Wrapper for @aws-sdk/lib-dynamodb to make single-table design easier

License

Notifications You must be signed in to change notification settings

awboost/ddb-table-client

Repository files navigation

@awboost/ddb-table-client

This package is intended as an (almost) drop-in replacement for @aws-sdk/lib-dynamodb, with the only difference being that you don't have to specify the table on every command. Instead you specify the table once for the client object.

This makes it easier to implement single-table design.

Documentation

See documentation.

Example

import { DynamoDBClient } from '@aws-sdk/client-dynamodb';
import { DynamoDBTableClient, GetCommand } from '@awboost/ddb-table-client';

const client = new DynamoDBClient({});

const tableClient = DynamoDBTableClient.from(client, {
  tableName: 'mytable',
});

const result = await tableClient.send(
  new GetCommand({
    // look, no TableName property!
    Key: { id: '1234' },
  }),
);

About

Wrapper for @aws-sdk/lib-dynamodb to make single-table design easier

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published