Skip to content

Commit 15b1d6c

Browse files
authored
Add initial support for DynamoDB DocumentClient transformation (#450)
1 parent e83a169 commit 15b1d6c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+361
-9
lines changed

.changeset/fresh-pears-rescue.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"aws-sdk-js-codemod": minor
3+
---
4+
5+
Add initial support for DynamoDB DocumentClient transformation
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import AWS = require("aws-sdk");
2+
3+
const documentClient = new AWS.DynamoDB.DocumentClient({ region: "us-west-2" });
4+
const response = await documentClient.scan({ TableName: "TABLE_NAME" }).promise();
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import AWS_lib_dynamodb = require("@aws-sdk/lib-dynamodb");
2+
3+
const {
4+
DynamoDBDocument
5+
} = AWS_lib_dynamodb;
6+
7+
import AWS_DynamoDB = require("@aws-sdk/client-dynamodb");
8+
9+
const {
10+
DynamoDB
11+
} = AWS_DynamoDB;
12+
13+
const documentClient = DynamoDBDocument.from(new DynamoDB({ region: "us-west-2" }));
14+
const response = await documentClient.scan({ TableName: "TABLE_NAME" });
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import AWS from "aws-sdk";
2+
3+
const documentClient = new AWS.DynamoDB.DocumentClient({ region: "us-west-2" });
4+
const response = await documentClient.scan({ TableName: "TABLE_NAME" }).promise();
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { DynamoDBDocument } from "@aws-sdk/lib-dynamodb";
2+
import { DynamoDB } from "@aws-sdk/client-dynamodb";
3+
4+
const documentClient = DynamoDBDocument.from(new DynamoDB({ region: "us-west-2" }));
5+
const response = await documentClient.scan({ TableName: "TABLE_NAME" });
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
const AWS = require("aws-sdk");
2+
3+
const documentClient = new AWS.DynamoDB.DocumentClient({ region: "us-west-2" });
4+
const response = await documentClient.scan({ TableName: "TABLE_NAME" }).promise();
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const {
2+
DynamoDBDocument
3+
} = require("@aws-sdk/lib-dynamodb"),
4+
{
5+
DynamoDB
6+
} = require("@aws-sdk/client-dynamodb");
7+
8+
const documentClient = DynamoDBDocument.from(new DynamoDB({ region: "us-west-2" }));
9+
const response = await documentClient.scan({ TableName: "TABLE_NAME" });
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import DynamoDBClient from "aws-sdk/clients/dynamodb";
2+
3+
const documentClient = new DynamoDBClient.DocumentClient({ region: "us-west-2" });
4+
const response = await documentClient.scan({ TableName: "TABLE_NAME" }).promise();
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { DynamoDBDocument } from "@aws-sdk/lib-dynamodb";
2+
import { DynamoDB as DynamoDBClient } from "@aws-sdk/client-dynamodb";
3+
4+
const documentClient = DynamoDBDocument.from(new DynamoDBClient({ region: "us-west-2" }));
5+
const response = await documentClient.scan({ TableName: "TABLE_NAME" });
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import DynamoDB from "aws-sdk/clients/dynamodb";
2+
3+
const documentClient = new DynamoDB.DocumentClient({ region: "us-west-2" });
4+
const response = await documentClient.scan({ TableName: "TABLE_NAME" }).promise();

0 commit comments

Comments
 (0)