@effect-aws/client-dynamodb
v1.5.0
Published
[![npm version](https://img.shields.io/npm/v/%40effect-aws%2Fclient-dynamodb?color=brightgreen&label=npm%20package)](https://www.npmjs.com/package/@effect-aws/client-dynamodb) [![npm downloads](https://img.shields.io/npm/dm/%40effect-aws%2Fclient-dynamodb
Downloads
1,195
Readme
@effect-aws/client-dynamodb
Installation
npm install --save @effect-aws/client-dynamodb
Usage
With default DynamoDBClient instance:
import { DynamoDB } from "@effect-aws/client-dynamodb";
const program = DynamoDB.putItem(args);
const result = pipe(
program,
Effect.provide(DynamoDB.defaultLayer),
Effect.runPromise,
);
With custom DynamoDBClient instance:
import { DynamoDB } from "@effect-aws/client-dynamodb";
const program = DynamoDB.putItem(args);
const result = await pipe(
program,
Effect.provide(
DynamoDB.baseLayer(() => new DynamoDBClient({ region: "eu-central-1" })),
),
Effect.runPromise,
);
With custom DynamoDBClient configuration:
import { DynamoDB } from "@effect-aws/client-dynamodb";
const program = DynamoDB.putItem(args);
const result = await pipe(
program,
Effect.provide(DynamoDB.layer({ region: "eu-central-1" })),
Effect.runPromiseExit,
);
or use DynamoDB.baseLayer((default) => new DynamoDBClient({ ...default, region: "eu-central-1" }))