@veterancrowd/wrapped-dynamodb-client
v1.6.21
Published
An AWS DynamoDB client wrapped to provide consistent logging and other services.
Downloads
44
Readme
WrappedDynamoDbClient
This package wraps the DynamoDB Client - AWS SDK for JavaScript v3 to provide a streamlined developer experience and consistent logging.
API Documentation
wrapped-dynamodb-client.WrappedDynamoDbClient
Wraps an AWS DynamoDB client to provide standard logging & services.
Kind: static class of wrapped-dynamodb-client
- .WrappedDynamoDbClient
- new exports.WrappedDynamoDbClient([options])
- item
- .deleteItem(tableName, key) ⇒ Promise.<object>
- .deleteItems(tableName, keys) ⇒ Promise.<number>
- .getItem(tableName, key, [attributes]) ⇒ Promise.<object>
- .purgeItems(tableName, keys) ⇒ Promise.<number>
- .putItem(tableName, item) ⇒ Promise.<object>
- .putItems(tableName, items) ⇒ Promise.<Array>
- .query(tableName, options) ⇒ Promise.<object>
- .scan(tableName, options) ⇒ Promise.<object>
- .transactDeleteItems(tableName, keys) ⇒ Promise.<Array>
- .transactPutItems(tableName, items) ⇒ Promise.<Array>
- table
- .createTable(tableName, [options]) ⇒ Promise.<object>
- .deleteTable(tableName) ⇒ Promise.<object>
- .describeTable(tableName) ⇒ Promise.<object>
new exports.WrappedDynamoDbClient([options])
WrappedDynamoDbClient constructor.
| Param | Type | Description | | --- | --- | --- | | [options] | object | Options. | | [options.logger] | object | Logger instance (default is global console object). Must have info, error & debug methods | | [options.logInternals] | boolean | Log AWS client internals (default is false). | | [options.config] | object | DynamoDBClientConfig object. |
wrappedDynamoDbClient.deleteItem(tableName, key) ⇒ Promise.<object>
Delete an item from a DynamoDB table.
Kind: instance method of WrappedDynamoDbClient
Returns: Promise.<object> - WaiterResult object.
Category: item
| Param | Type | Description | | --- | --- | --- | | tableName | string | Table name. | | key | object | Item object (only the key is required). |
wrappedDynamoDbClient.deleteItems(tableName, keys) ⇒ Promise.<number>
Delete multiple items from a DynamoDB table.
Kind: instance method of WrappedDynamoDbClient
Returns: Promise.<number> - Array of responses from chunked batchWrite operations.
Category: item
| Param | Type | Description | | --- | --- | --- | | tableName | string | Table name. | | keys | Array.<object> | Array of item objects (only the key is required). |
wrappedDynamoDbClient.getItem(tableName, key, [attributes]) ⇒ Promise.<object>
Get an item from a DynamoDB table.
Kind: instance method of WrappedDynamoDbClient
Returns: Promise.<object> - - GetItemCommandOutput object.
Category: item
| Param | Type | Description | | --- | --- | --- | | tableName | string | Table name. | | key | object | Item object (only the key is required). | | [attributes] | string | Array.<string> | Comma-delimited list or string array of attributes to retrieve. |
wrappedDynamoDbClient.purgeItems(tableName, keys) ⇒ Promise.<number>
Purge all items from a DynamoDB table.
Kind: instance method of WrappedDynamoDbClient
Returns: Promise.<number> - Total items purged from table.
Category: item
| Param | Type | Description | | --- | --- | --- | | tableName | string | Table name. | | keys | Array.<string> | Item keys. |
wrappedDynamoDbClient.putItem(tableName, item) ⇒ Promise.<object>
Put an item into a DynamoDB table.
Kind: instance method of WrappedDynamoDbClient
Returns: Promise.<object> - - PutItemCommandOutput object.
Category: item
| Param | Type | Description | | --- | --- | --- | | tableName | string | Table name. | | item | object | Item object. |
wrappedDynamoDbClient.putItems(tableName, items) ⇒ Promise.<Array>
Put multiple items into a DynamoDB table.
Kind: instance method of WrappedDynamoDbClient
Returns: Promise.<Array> - Array of responses from chunked batchWrite operations.
Category: item
| Param | Type | Description | | --- | --- | --- | | tableName | string | Table name. | | items | Array.<object> | Array of item objects. |
wrappedDynamoDbClient.query(tableName, options) ⇒ Promise.<object>
Query items from a DynamoDB table.
Kind: instance method of WrappedDynamoDbClient
Returns: Promise.<object> - QueryCommandOutput object.
Category: item
| Param | Type | Description | | --- | --- | --- | | tableName | string | Table name. | | options | object | QueryCommandInput object. |
wrappedDynamoDbClient.scan(tableName, options) ⇒ Promise.<object>
Scan items from a DynamoDB table.
Kind: instance method of WrappedDynamoDbClient
Returns: Promise.<object> - ScanCommandOutput object.
Category: item
| Param | Type | Description | | --- | --- | --- | | tableName | string | Table name. | | options | object | ScanCommandInput object. |
wrappedDynamoDbClient.transactDeleteItems(tableName, keys) ⇒ Promise.<Array>
Delete multiple items from a DynamoDB table as a single transaction.
Kind: instance method of WrappedDynamoDbClient
Returns: Promise.<Array> - Array of responses from chunked batchWrite operations.
Category: item
| Param | Type | Description | | --- | --- | --- | | tableName | string | Table name. | | keys | Array.<object> | Array of item keys. |
wrappedDynamoDbClient.transactPutItems(tableName, items) ⇒ Promise.<Array>
Put multiple items into a DynamoDB table as a single transaction.
Kind: instance method of WrappedDynamoDbClient
Returns: Promise.<Array> - Array of responses from chunked batchWrite operations.
Category: item
| Param | Type | Description | | --- | --- | --- | | tableName | string | Table name. | | items | Array.<object> | Array of item objects. |
wrappedDynamoDbClient.createTable(tableName, [options]) ⇒ Promise.<object>
Create a DynamoDB table.
Kind: instance method of WrappedDynamoDbClient
Returns: Promise.<object> - WaiterResult object.
Category: table
| Param | Type | Description | | --- | --- | --- | | tableName | string | Table name. | | [options] | object | CreateTableCommandInput object. |
wrappedDynamoDbClient.deleteTable(tableName) ⇒ Promise.<object>
Delete a DynamoDB table.
Kind: instance method of WrappedDynamoDbClient
Returns: Promise.<object> - - Deletion status
Category: table
| Param | Type | Description | | --- | --- | --- | | tableName | string | Table name. |
wrappedDynamoDbClient.describeTable(tableName) ⇒ Promise.<object>
Describe a DynamoDB table.
Kind: instance method of WrappedDynamoDbClient
Returns: Promise.<object> - - TableDescription}
Category: table
| Param | Type | Description | | --- | --- | --- | | tableName | string | Table name. |
See more great templates and other tools on my GitHub Profile!