47

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?

Jon Schneider
  • 25,758
  • 23
  • 142
  • 170
yash
  • 471
  • 1
  • 4
  • 6
  • You can check this answer http://stackoverflow.com/questions/20856530/dynamodb-client-in-local-with-ui-like-phpmyadmin – Nishant May 19 '16 at 10:12
  • you cant. in dynamodb you need to specify hash key in order to get a result. – Eyal Ch May 19 '16 at 10:01

5 Answers5

45

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();
notionquest
  • 37,595
  • 6
  • 111
  • 105
  • When I try to run this code Error is coming like "cannot do operations on a non-existence table" Also I have created the table through code. From that table, I am able to update, delete the data from my code. – Bandana Sahu May 21 '19 at 04:21
  • 1
    Just have to change the `tableName` variable in line 5 @bandana. – Jonn Jun 06 '19 at 03:48
  • how to list tables? – Mayur Oct 22 '19 at 08:03
38

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:

kooskoos
  • 4,622
  • 1
  • 12
  • 29
wassgren
  • 18,651
  • 6
  • 63
  • 77
11

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

toddmetheny
  • 4,405
  • 1
  • 22
  • 39
5

This open-source (dynamodb-manager) tool is pretty good.

It has the following features:

Table

  • Add Table
  • Edit Table
  • Delete Table
  • Connect Table
  • Add Index(GSI and LSI)
  • Delete Index

Item

  • Add Item
  • Edit Item
  • Delete Item
  • import/export Items

Search (Table or Index)

  • Scan Table
  • Query Table
  • Filter Condition

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/

stayingcool
  • 2,324
  • 1
  • 21
  • 24
1

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

Mukundhan
  • 3,284
  • 23
  • 36