File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,8 @@ yarn add @classmethod/athena-query @aws-sdk/client-athena
24
24
25
25
## Usage
26
26
27
+ ### Basic Usage
28
+
27
29
Athena-Query provide [ async generator function] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function* ) .
28
30
So we can use it with ` for await () {} ` ,
29
31
@@ -41,6 +43,33 @@ for await (const item of athenaQuery.query("SELECT * FROM waf_logs;")) {
41
43
42
44
And if you break loop out, Athena-Query don't call unnecessary pages of ` get-query-result ` api.
43
45
46
+ ### Options
47
+
48
+ When you initialize AthenaQuery class, you can pass options to specify the query target.
49
+
50
+ ``` ts
51
+ const athenaQuery = new AthenaQuery (athena , {
52
+ db: " test-db" ,
53
+ workgroup: " test-workgroup" ,
54
+ catalog: " test-catalog" ,
55
+ });
56
+ ```
57
+
58
+ When you query to Athena, you can pass options for query.
59
+
60
+ ``` ts
61
+ const resultGen = athenaQuery .query (
62
+ `
63
+ SELECT * FROM waf_logs
64
+ WHERE name = ? AND groupId = ? AND score > ?;
65
+ ` ,
66
+ {
67
+ executionParameters: [" test" , 123 , 456n ],
68
+ maxResults: 100 ,
69
+ }
70
+ );
71
+ ```
72
+
44
73
## Release
45
74
46
75
See [ here] ( https://www.notion.so/athena-query-8d4fd5d098b944028dd9c7066a47ffe4#ee977ecfee9840c09e8d7b5a2ed5d3e3 ) . (private)
You can’t perform that action at this time.
0 commit comments