@stilyng94/athena-query-client 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,9 +25,9 @@ import {
|
|
|
25
25
|
JsonFileAppender,
|
|
26
26
|
} from "@stilyng94/athena-query-client";
|
|
27
27
|
|
|
28
|
-
const
|
|
28
|
+
const athenaQuery = "SELECT * from api_logs";
|
|
29
29
|
|
|
30
|
-
const execute = async (query) => {
|
|
30
|
+
const execute = async (query: string) => {
|
|
31
31
|
const athena = new AthenaQueryClient({
|
|
32
32
|
Catalog: "catalog",
|
|
33
33
|
Database: "logs",
|
|
@@ -37,7 +37,7 @@ const execute = async (query) => {
|
|
|
37
37
|
s3Region: "us-west-2",
|
|
38
38
|
});
|
|
39
39
|
|
|
40
|
-
const queryExecutionId = await athena.query();
|
|
40
|
+
const queryExecutionId = await athena.query(query);
|
|
41
41
|
|
|
42
42
|
const jsonFileAppender = new JsonFileAppender({
|
|
43
43
|
directory: "",
|
|
@@ -60,7 +60,7 @@ const execute = async (query) => {
|
|
|
60
60
|
.catch((error) => console.error(error));
|
|
61
61
|
};
|
|
62
62
|
|
|
63
|
-
execute().catch(console.error);
|
|
63
|
+
execute(athenaQuery).catch(console.error);
|
|
64
64
|
```
|
|
65
65
|
|
|
66
66
|
## Get query results and map to Js object
|
|
@@ -71,9 +71,9 @@ import {
|
|
|
71
71
|
MappedQueryResultProcessor,
|
|
72
72
|
} from "@stilyng94/athena-query-client";
|
|
73
73
|
|
|
74
|
-
const
|
|
74
|
+
const athenaQuery = "SELECT * from api_logs";
|
|
75
75
|
|
|
76
|
-
const execute = async (query) => {
|
|
76
|
+
const execute = async (query: string) => {
|
|
77
77
|
const athena = new AthenaQueryClient({
|
|
78
78
|
Catalog: "catalog",
|
|
79
79
|
Database: "logs",
|
|
@@ -83,7 +83,7 @@ const execute = async (query) => {
|
|
|
83
83
|
s3Region: "us-west-2",
|
|
84
84
|
});
|
|
85
85
|
|
|
86
|
-
const queryExecutionId = await athena.query();
|
|
86
|
+
const queryExecutionId = await athena.query(query);
|
|
87
87
|
|
|
88
88
|
const mappedQueryResultProcessor = new MappedQueryResultProcessor({
|
|
89
89
|
athenaClient: athena,
|
|
@@ -93,5 +93,5 @@ const execute = async (query) => {
|
|
|
93
93
|
});
|
|
94
94
|
};
|
|
95
95
|
|
|
96
|
-
execute().catch(console.error);
|
|
96
|
+
execute(athenaQuery).catch(console.error);
|
|
97
97
|
```
|
package/package.json
CHANGED