In this video, we are going to listing dynamic TV tables with using a SDK package.
So this time we will use list table command.
So in order to do that, please open the API reference documentation.
Here you can find the client dynamo DB package.
If you see the right hand side, you can see the available commands on Dynamo DB.
If you scroll down, you can see the list table commands.
If you scroll down or search on the list table commands.
You can see in here we have list tables, command.
If you click this command, you can see how we can use this command in our application.
This is very common.
We will use client object when importing this package and this time we will use list table command.
And after that, passing this command to our client object in order to perform list command.
We don't have any parameters since this is the list command.
Maybe we can put a few parameters.
You can see the parameters in the input object.
You can see that you can set the limit and exclusive start table name properties for this operation.
So let's get started.
So please open the visual code.
I have created separate folder for the lecture and added the command text file that we are going to
follow these steps.
So basically we will follow the same steps what we have done in the previous video.
We should install record packets, create dynamo DB client object and we will develop actual logic into
separate JavaScript file and run the node command.
So remember that every lecture has a separate Node.js application.
For that purpose.
We should install the required dynamo ADB package in every lecture folder.
For that purpose, open the terminal and go to a related folder.
And.
On this command, which is the NPM install client dynamo DB.
From this comment.
After running this API install command, we have created package JSON files and known models.
So in the next step we forgot the one thing in here.
We should edit the package json file.
Let me add here one more step, which is the 1.1.
Update package.
Jason File.
Which will be the type module.
Go to package JSON and come in here.
Select the type as a model which will be activate is six modules.
So let me copy this line of code and paste in here.
This is important step and after that second step is create dynamic DB client object to expose the DB
client object in order to interact with Dynamic DB.
For that purpose, I'm going to copy from the previous lecture the DB client and paste into our folder,
which is the dynamic DB client.
It is basically exposing this client object into our region to interact with dynamic DB.
This is very important and best practice is to create a separate Node.js module and we have done with
the second step.
And the third step is they will have actual code on our separate JSON file.
Since we are developing list tables, I'm going to create a new JavaScript file.
Which name is list tables?
Please create a new file under the lecture folder.
Which name is list tables?
JavaScript file.
I can close this command window for now.
So basically we will implement our actual logic in here with using the dynamic DB client object.
We have installed the required package in our package jason file and activate the ES6 modules.
Okay.
Now let's focus on the list tables.
So in order to do that again, I'm going to copy our actual logic in here.
We need to run method which including the actual operations for that purpose.
I'm going to copy this method and paste in here.
So basically this is the minimum implementation of any interaction with using Sdhc.
This time we are using the list table command so we can copy command name from the OR list tables command.
We can see in here, copy from our documentation and paste in here.
And this time I am not going to place any parameters for that purpose.
I'm placing an aim to object in here.
So now we should edit required import statements in here.
The first one is dynamic db client.
Come this line and click the control space import dynamic DB Client Please don't forget it.
Dot G's extension.
Otherwise it won't be work.
And after that we should add a record common tables, which is the list table commands.
Come here, click the control space and import required object which comes from the Our SDK package,
which is the client dynamic.
DB Now we can run the R code.
Of course I need to change this log operation.
And now please open a new terminal and go to.
Section 20 and Lecture 165 OC We are in the same directory.
Now we can run the command for that purpose.
Please write the note list tables.
JS So if you hit the answer, these will be interact with the dynamic.
DB And listing our table names.
As you can see that we have only one table, which is the order and see that we have successfully sent
Dynamo DB API call for the list tables, command and dynamic db return back to us the table names,
which is the order.
So that means in our local computer.
Let me show in here.
We are writing our Node.js application on our local computer.
Here is our lecture folder.
And these lecture folder are using the HDC packets.
Which SDK package is client A.B?
We have create a dynamic DB client object and after that we are sending a list table commands in order
to interact with dynamic DB and dynamic db API.
Return back to us using the K package and we can see the table names in our local command window to
run these Node.js function.
So we will follow the same steps for the other commands.
But the idea is that after this section we will make these local Node.js modules and functions to the
Lambda function and see how they interact lambda function with different resources using the Node.js
runtime and using the async JavaScript version three operations.