For listing all tables in a locally-installed instance of DynamoDB, I know that the command is:
aws dynamodb list-tables --endpoint-url http://localhost:8000
Now, I want to view the contents of one of the tables. What is the command to do that?
For listing all tables in a locally-installed instance of DynamoDB, I know that the command is:
aws dynamodb list-tables --endpoint-url http://localhost:8000
Now, I want to view the contents of one of the tables. What is the command to do that?
Go to "http://localhost:8000/shell/" and execute the below script. Please change the table name as per your requirement.
When you run the local DynamoDB the above URL should be up and running.
var dynamodb = new AWS.DynamoDB({
region: 'us-east-1',
endpoint: "http://localhost:8000"
});
var tableName = "TESTTABLE";
var params = {
TableName: tableName,
Select: "ALL_ATTRIBUTES"
};
function doScan(response) {
if (response.error) ppJson(response.error); // an error occurred
else {
ppJson(response.data); // successful response
// More data. Keep calling scan.
if ('LastEvaluatedKey' in response.data) {
response.request.params.ExclusiveStartKey = response.data.LastEvaluatedKey;
dynamodb.scan(response.request.params)
.on('complete', doScan)
.send();
}
}
}
console.log("Starting a Scan of the table");
dynamodb.scan(params)
.on('complete', doScan)
.send();
One way of viewing local dynamodb data is to use the command line. You can e.g. do a scan
of the table. Please note that the scan
-command can be heavy.
aws dynamodb scan \
--table-name my_table_name \
--endpoint-url http://localhost:8000
Skip the --endpoint-url
parameter if you are using a managed version of DynamoDB.
If you do not wish to do a scan
, perhaps the get-item
-command may be suitable.
Commands:
A free visualization option for dynamodb local that I came across recently is dyanamodb-admin
. You can check it out here: https://github.com/aaronshaf/dynamodb-admin
This open-source (dynamodb-manager) tool is pretty good.
It has the following features:
Table
Item
Search (Table or Index)
Usage:
docker pull taydy/dynamodb-manager
docker run -t -p 8080:80 taydy/dynamodb-manager
Open the following URL in the browser:
http://localhost:8080/ or http://127.0.0.1:8080/
RazorSql does this where dynamo-db can be connected and queried like an sql with dynamo-db limitations.
https://razorsql.com/docs/installation.html
It comes with 30 days trial license.
Doc:https://razorsql.com/docs/dynamodb_sql_support.html#select_scan