Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add aws-dynamodb driver #234

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
update docs
pi0 committed Aug 7, 2023
commit 4104258286eb1c98e50dc8f9177e0bb4667d8dee
12 changes: 6 additions & 6 deletions docs/content/6.drivers/aws-dynamodb.md
Original file line number Diff line number Diff line change
@@ -7,17 +7,17 @@ This driver uses the DynamoDB table as a key value store. By default it uses the
To use it, you will need to install `@aws-sdk/client-dynamodb` and `@aws-sdk/lib-dynamodb` in your project:

```bash
npm i @aws-sdk/client-dynamodb @aws-sdk/lib-dynamodb
npm i -D @aws-sdk/client-dynamodb @aws-sdk/lib-dynamodb
```

Minimal usage:
**Usage:**

```js
import { createStorage } from "unstorage";
import dynamoDbCacheDriver from "unstorage/drivers/aws-dynamodb";
import dynamoDBDriver from "unstorage/drivers/aws-dynamodb";

const storage = createStorage({
driver: dynamoDbCacheDriver({
driver: dynamoDBDriver({
table: "my-persistent-storage", // required
region: "us-east-1", // optional, retrieved via environment variables
credentials: {
@@ -33,10 +33,10 @@ Persistent configuration usage:

```js
import { createStorage } from "unstorage";
import dynamoDbCacheDriver from "unstorage/drivers/aws-dynamodb";
import dynamoDBDriver from "unstorage/drivers/aws-dynamodb";

const storage = createStorage({
driver: dynamoDbCacheDriver({
driver: dynamoDBDriver({
table: "my-table-name", // required
attributes: {
key: "key", // optional, configure attributes name