1
00:00:00,360 --> 00:00:07,620
In this video, we are going to listing dynamic TV tables with using a SDK package.

2
00:00:07,710 --> 00:00:10,740
So this time we will use list table command.

3
00:00:11,670 --> 00:00:15,780
So in order to do that, please open the API reference documentation.

4
00:00:15,990 --> 00:00:18,810
Here you can find the client dynamo DB package.

5
00:00:18,840 --> 00:00:24,030
If you see the right hand side, you can see the available commands on Dynamo DB.

6
00:00:24,180 --> 00:00:27,540
If you scroll down, you can see the list table commands.

7
00:00:27,540 --> 00:00:31,410
If you scroll down or search on the list table commands.

8
00:00:31,440 --> 00:00:34,950
You can see in here we have list tables, command.

9
00:00:34,980 --> 00:00:39,870
If you click this command, you can see how we can use this command in our application.

10
00:00:39,900 --> 00:00:41,150
This is very common.

11
00:00:41,160 --> 00:00:47,560
We will use client object when importing this package and this time we will use list table command.

12
00:00:47,580 --> 00:00:53,040
And after that, passing this command to our client object in order to perform list command.

13
00:00:53,070 --> 00:00:56,760
We don't have any parameters since this is the list command.

14
00:00:56,790 --> 00:00:59,260
Maybe we can put a few parameters.

15
00:00:59,280 --> 00:01:02,520
You can see the parameters in the input object.

16
00:01:02,550 --> 00:01:09,470
You can see that you can set the limit and exclusive start table name properties for this operation.

17
00:01:09,480 --> 00:01:10,890
So let's get started.

18
00:01:10,890 --> 00:01:12,990
So please open the visual code.

19
00:01:13,110 --> 00:01:18,630
I have created separate folder for the lecture and added the command text file that we are going to

20
00:01:18,630 --> 00:01:19,860
follow these steps.

21
00:01:19,860 --> 00:01:24,000
So basically we will follow the same steps what we have done in the previous video.

22
00:01:24,030 --> 00:01:30,420
We should install record packets, create dynamo DB client object and we will develop actual logic into

23
00:01:30,420 --> 00:01:33,480
separate JavaScript file and run the node command.

24
00:01:33,750 --> 00:01:38,100
So remember that every lecture has a separate Node.js application.

25
00:01:38,100 --> 00:01:39,080
For that purpose.

26
00:01:39,090 --> 00:01:44,370
We should install the required dynamo ADB package in every lecture folder.

27
00:01:44,400 --> 00:01:51,360
For that purpose, open the terminal and go to a related folder.

28
00:01:52,970 --> 00:01:53,750
And.

29
00:01:55,400 --> 00:02:00,770
On this command, which is the NPM install client dynamo DB.

30
00:02:01,660 --> 00:02:02,940
From this comment.

31
00:02:03,390 --> 00:02:08,870
After running this API install command, we have created package JSON files and known models.

32
00:02:08,880 --> 00:02:13,530
So in the next step we forgot the one thing in here.

33
00:02:13,560 --> 00:02:16,560
We should edit the package json file.

34
00:02:16,590 --> 00:02:20,730
Let me add here one more step, which is the 1.1.

35
00:02:22,540 --> 00:02:24,160
Update package.

36
00:02:26,150 --> 00:02:27,140
Jason File.

37
00:02:29,480 --> 00:02:31,040
Which will be the type module.

38
00:02:31,070 --> 00:02:33,740
Go to package JSON and come in here.

39
00:02:33,740 --> 00:02:38,660
Select the type as a model which will be activate is six modules.

40
00:02:38,660 --> 00:02:41,900
So let me copy this line of code and paste in here.

41
00:02:41,930 --> 00:02:47,840
This is important step and after that second step is create dynamic DB client object to expose the DB

42
00:02:47,840 --> 00:02:51,500
client object in order to interact with Dynamic DB.

43
00:02:51,530 --> 00:02:58,310
For that purpose, I'm going to copy from the previous lecture the DB client and paste into our folder,

44
00:02:58,310 --> 00:03:00,020
which is the dynamic DB client.

45
00:03:00,020 --> 00:03:05,540
It is basically exposing this client object into our region to interact with dynamic DB.

46
00:03:05,570 --> 00:03:11,150
This is very important and best practice is to create a separate Node.js module and we have done with

47
00:03:11,150 --> 00:03:12,200
the second step.

48
00:03:12,200 --> 00:03:17,360
And the third step is they will have actual code on our separate JSON file.

49
00:03:17,390 --> 00:03:23,600
Since we are developing list tables, I'm going to create a new JavaScript file.

50
00:03:23,600 --> 00:03:25,970
Which name is list tables?

51
00:03:25,970 --> 00:03:29,240
Please create a new file under the lecture folder.

52
00:03:29,270 --> 00:03:31,220
Which name is list tables?

53
00:03:31,220 --> 00:03:32,330
JavaScript file.

54
00:03:32,360 --> 00:03:35,210
I can close this command window for now.

55
00:03:35,210 --> 00:03:40,430
So basically we will implement our actual logic in here with using the dynamic DB client object.

56
00:03:40,460 --> 00:03:46,340
We have installed the required package in our package jason file and activate the ES6 modules.

57
00:03:46,340 --> 00:03:47,000
Okay.

58
00:03:47,030 --> 00:03:49,190
Now let's focus on the list tables.

59
00:03:49,190 --> 00:03:54,050
So in order to do that again, I'm going to copy our actual logic in here.

60
00:03:54,050 --> 00:03:59,990
We need to run method which including the actual operations for that purpose.

61
00:03:59,990 --> 00:04:03,500
I'm going to copy this method and paste in here.

62
00:04:03,680 --> 00:04:09,230
So basically this is the minimum implementation of any interaction with using Sdhc.

63
00:04:09,260 --> 00:04:17,210
This time we are using the list table command so we can copy command name from the OR list tables command.

64
00:04:17,210 --> 00:04:21,290
We can see in here, copy from our documentation and paste in here.

65
00:04:21,290 --> 00:04:24,680
And this time I am not going to place any parameters for that purpose.

66
00:04:24,680 --> 00:04:27,170
I'm placing an aim to object in here.

67
00:04:27,170 --> 00:04:32,060
So now we should edit required import statements in here.

68
00:04:32,090 --> 00:04:34,040
The first one is dynamic db client.

69
00:04:34,040 --> 00:04:40,100
Come this line and click the control space import dynamic DB Client Please don't forget it.

70
00:04:40,400 --> 00:04:42,110
Dot G's extension.

71
00:04:42,110 --> 00:04:43,580
Otherwise it won't be work.

72
00:04:43,670 --> 00:04:48,770
And after that we should add a record common tables, which is the list table commands.

73
00:04:48,770 --> 00:04:56,420
Come here, click the control space and import required object which comes from the Our SDK package,

74
00:04:56,420 --> 00:04:57,660
which is the client dynamic.

75
00:04:57,660 --> 00:05:00,560
DB Now we can run the R code.

76
00:05:00,590 --> 00:05:04,340
Of course I need to change this log operation.

77
00:05:04,640 --> 00:05:08,420
And now please open a new terminal and go to.

78
00:05:09,380 --> 00:05:17,300
Section 20 and Lecture 165 OC We are in the same directory.

79
00:05:17,330 --> 00:05:20,590
Now we can run the command for that purpose.

80
00:05:20,600 --> 00:05:23,630
Please write the note list tables.

81
00:05:23,940 --> 00:05:28,820
JS So if you hit the answer, these will be interact with the dynamic.

82
00:05:28,820 --> 00:05:31,430
DB And listing our table names.

83
00:05:31,460 --> 00:05:38,390
As you can see that we have only one table, which is the order and see that we have successfully sent

84
00:05:38,690 --> 00:05:45,140
Dynamo DB API call for the list tables, command and dynamic db return back to us the table names,

85
00:05:45,140 --> 00:05:46,460
which is the order.

86
00:05:46,460 --> 00:05:48,950
So that means in our local computer.

87
00:05:49,280 --> 00:05:50,600
Let me show in here.

88
00:05:50,750 --> 00:05:54,500
We are writing our Node.js application on our local computer.

89
00:05:54,530 --> 00:05:56,330
Here is our lecture folder.

90
00:05:56,330 --> 00:05:59,540
And these lecture folder are using the HDC packets.

91
00:05:59,540 --> 00:06:02,150
Which SDK package is client A.B?

92
00:06:02,180 --> 00:06:08,840
We have create a dynamic DB client object and after that we are sending a list table commands in order

93
00:06:08,840 --> 00:06:12,010
to interact with dynamic DB and dynamic db API.

94
00:06:12,020 --> 00:06:18,890
Return back to us using the K package and we can see the table names in our local command window to

95
00:06:18,890 --> 00:06:21,230
run these Node.js function.

96
00:06:21,740 --> 00:06:24,620
So we will follow the same steps for the other commands.

97
00:06:24,620 --> 00:06:31,490
But the idea is that after this section we will make these local Node.js modules and functions to the

98
00:06:31,490 --> 00:06:38,330
Lambda function and see how they interact lambda function with different resources using the Node.js

99
00:06:38,330 --> 00:06:43,360
runtime and using the async JavaScript version three operations.
