1.0.1 • Published 4 months ago
@effect-aws/dynamodb v1.0.1
@effect-aws/dynamodb
Installation
npm install --save @effect-aws/dynamodb
Usage
With default DynamoDBClient instance:
import { DynamoDBDocument } from "@effect-aws/dynamodb"
const program = DynamoDBDocument.put(args)
const result = pipe(
program,
Effect.provide(DynamoDBDocument.defaultLayer),
Effect.runPromise
)
With custom DynamoDBClient instance:
import { DynamoDBDocument } from "@effect-aws/dynamodb"
const program = DynamoDBDocument.put(args)
const result = await pipe(
program,
Effect.provide(
DynamoDBDocumentClient.from(
new DynamoDBClient({ region: "eu-central-1" }),
{ marshallOptions: { removeUndefinedValues: true } }
)
),
Effect.runPromise
)
With custom DynamoDBClient configuration:
import { DynamoDBDocument } from "@effect-aws/dynamodb"
const program = DynamoDBDocument.put(args)
const result = await pipe(
program,
Effect.provide(
DynamoDBDocument.layer({
marshallOptions: { removeUndefinedValues: true }
})
),
Effect.runPromiseExit
)
or use DynamoDBDocument.baseLayer((default) => DynamoDBDocumentClient.from(new DynamoDBClient({ ...default, region: "eu-central-1" }), { marshallOptions: { removeUndefinedValues: true } }))