1
00:00:00,210 --> 00:00:07,650
In this video, we are going to describing existing Dynamo DB tables with using the Dynamo DB packets.

2
00:00:07,770 --> 00:00:14,760
In order to do that, please open the our visual code and I have created separate lecture folder in

3
00:00:14,760 --> 00:00:17,580
here and follow the same steps.

4
00:00:17,580 --> 00:00:24,390
What we have done in the last videos is remember that we have installed required DB packets and create

5
00:00:24,390 --> 00:00:32,430
dynamo db client separate Node.js module and now we will develop our actual code into the describing

6
00:00:32,460 --> 00:00:33,510
tables command.

7
00:00:33,510 --> 00:00:41,130
So for that purpose or for that purpose, I have create describe table JavaScript file and create a

8
00:00:41,130 --> 00:00:44,190
run method with the basic implementation.

9
00:00:44,280 --> 00:00:47,160
As you remember, that is the structure of our implementation.

10
00:00:47,160 --> 00:00:50,910
We will make our call in this two step.

11
00:00:50,910 --> 00:00:56,220
So before this step I would like to search for the describe table command.

12
00:00:56,250 --> 00:01:03,510
In our API reference documentation, you can come to the dynamic DB client object and search for the

13
00:01:03,510 --> 00:01:04,950
describe table command.

14
00:01:05,100 --> 00:01:11,250
If you click these describe table command, we can see the import statement in here.

15
00:01:11,280 --> 00:01:16,680
We will import dynamo DB, describe table command and this is the usage.

16
00:01:16,680 --> 00:01:22,980
And we can also see how we can send input parameters and get the outputs in these objects.

17
00:01:22,980 --> 00:01:29,280
Please click the describe table command input and see that we should provide the table name as a property

18
00:01:29,280 --> 00:01:30,240
of this command.

19
00:01:30,240 --> 00:01:36,330
So I'm going to send the request for the describe table command and send the table name as a parameter

20
00:01:36,330 --> 00:01:37,260
of this command.

21
00:01:37,470 --> 00:01:41,730
So please open the OR we just record and come to implementation part.

22
00:01:41,760 --> 00:01:48,630
Now we are going to implement our logic, which is the sending request to the describe table command.

23
00:01:48,660 --> 00:01:52,290
In order to do that, I'm going to copy and paste this line of code.

24
00:01:52,320 --> 00:01:58,800
This is the or core line of the code which basically using the client object and assigned the describe

25
00:01:58,800 --> 00:01:59,640
table command.

26
00:01:59,640 --> 00:02:04,400
So let's record import statements in our application, okay?

27
00:02:04,410 --> 00:02:11,250
If you come this line of code and come to control space and click the first result, you can see that

28
00:02:11,250 --> 00:02:17,220
we have successfully import describe table command from the our dynamic DB SDK and it's the same way

29
00:02:17,220 --> 00:02:22,740
we should import dynamo DB client module which comes from the our.

30
00:02:25,040 --> 00:02:25,550
Object.

31
00:02:25,550 --> 00:02:26,750
You can see in here.

32
00:02:26,750 --> 00:02:35,060
I have saved the file and come here and again put the input statement, click that JS file.

33
00:02:35,530 --> 00:02:36,930
Okay, very good.

34
00:02:36,950 --> 00:02:41,750
Now we have imported required statement and it is time to invoke these.

35
00:02:42,020 --> 00:02:44,050
Describe table command.

36
00:02:44,060 --> 00:02:49,810
Please open the terminal and go to correct folder structure and run the node command.

37
00:02:49,820 --> 00:02:52,610
So I'm going to run the node.

38
00:02:54,320 --> 00:02:55,610
Scrap table.

39
00:02:55,610 --> 00:02:58,760
JS So hit the answer and see the result.

40
00:02:59,660 --> 00:03:06,080
So as you can see that we've got the parameters we have to add the parameters for our case parameters

41
00:03:06,080 --> 00:03:12,470
should be include a table name for that purpose before running the our method.

42
00:03:12,500 --> 00:03:16,220
Come here and create a parameters object in here.

43
00:03:16,250 --> 00:03:18,470
And we basically placing the table name.

44
00:03:18,470 --> 00:03:20,150
Our table name is order.

45
00:03:20,510 --> 00:03:26,030
So after defining the parameters, we passing the parameters to the described table command.

46
00:03:26,030 --> 00:03:32,270
If you come to our terminal and run our node command again.

47
00:03:34,390 --> 00:03:41,740
See that this time we will get describing documentation of the table or table definition and all properties,

48
00:03:41,740 --> 00:03:45,460
including in this JSON file that we can successfully run.

49
00:03:45,460 --> 00:03:49,000
Describe command and get back response from the Dynamo DB.
