aws-sdk : DynamoDB : Fetch list of all tables

dynamodb list tables python
dynamodb list tables java
aws dynamodb list-tables
dynamodb list tables boto3
aws cli command to list dynamodb tables
dynamodb list all items
aws dynamodb query sdk
dynamodb local

I am using aws-sdk for nodejs in a project, and not finding any way to fetch all tables from an endpoint, in other words I am looking forward for equivalent of following command in SDK.

aws dynamodb list-tables --endpoint-url <ENDPOINT_URL>

Any help is much appreciated.

Regards.

Take a look at:

listTables(params = {}, callback)

"Returns an array of table names associated with the current account and endpoint."

Here: AWS SDK for JavaScript - DynamoDB

ListTables - Amazon DynamoDB, The following example uses the DynamoDB ListTables operation to list all of the tables in your default region. Create the file DynamoDBListTables.go. Add the  The following example uses the DynamoDB ListTables operation to list all of the tables in your default region. Create the file DynamoDBListTables.go . Add the following statements to import the Go and AWS SDK for Go packages used in the example. Initialize a session that the SDK will use to load credentials

Thanks friends, I found the solution as

 const AWS = require("aws-sdk");
 var dynamodb = new AWS.DynamoDB();
 var param = {}
    dynamodb.listTables(param, function (err, data) {
        if (err) console.log(err, err.stack); // an error occurred
        else     console.log(data);           // successful response
      });

Listing all Amazon DynamoDB Tables, Returns an array of table names associated with the current account and endpoint. Multiple API calls may be issued in order to retrieve the entire data set of results For more information, see Listing Table Names in the Amazon DynamoDB  TableNames. The names of the tables associated with the current account at the current endpoint. The maximum size of this array is 100. If LastEvaluatedTableName also appears in the output, you can use this value as the ExclusiveStartTableName

If you have more than 100 tables, then you also need to be aware of pagination. You can use this example for Node.js:

const readAllTables = async() => {
  const AWS = require("aws-sdk");
  var dynamodb = new AWS.DynamoDB();

  var params = {};
  var tables = [];

  while(true) {
    var response = await dynamodb.listTables(params).promise();
    tables = tables.concat(response.TableNames);

    if (undefined === response.LastEvaluatedTableName) {
      break;
    } else {
      params.ExclusiveStartTableName = response.LastEvaluatedTableName;
    }
  }

  return tables;
}

list-tables, The following code example uses the AWS SDK for Java Document API to create, update, and delete an Amazon DynamoDB table ( ExampleTable ). As part of  Create a JSON object containing the parameters needed to list your tables, which in this example limits the number of tables listed to 10. Call the listTables method of the DynamoDB service object.

Creating and Using Tables in DynamoDB, In step 4 of the tutorial, query and scan your data in an Amazon DynamoDB table using the AWS SDK for JavaScript SDK. How to Store and Fetch From DynamoDB With AWS Lambda of the DynamoDB table as to-do-list. we’re going to instantiate the DynamoDB DocumentClient object from the JavaScript AWS SDK. const

Example: Create, Update, Delete, and List Tables Using the AWS , Learn the key differences between the SELECT statement in a relational (SQL) database and the GetItem, Query, and Scan operations in Amazon DynamoDB. Working with Tables in DynamoDB. Tables are the containers for all items in a DynamoDB database. Before you can add or remove data from DynamoDB, you must create a table. For each table, you must define: A table name that is unique for your account and region.

Step 4: Query and Scan Data with AWS SDK for JavaScript in , items the query returns, and the names of attribute values to return for each item. Call the query method of the DynamoDB service object. // Load the AWS SDK  Query your tables using the Query method with these C# code examples in Amazon DynamoDB using the AWS SDK for .NET document model.