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
2424
2525## Usage
2626
27+ ### Basic Usage
28+
2729Athena-Query provide [ async generator function] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function* ) .
2830So we can use it with ` for await () {} ` ,
2931
@@ -41,6 +43,33 @@ for await (const item of athenaQuery.query("SELECT * FROM waf_logs;")) {
4143
4244And if you break loop out, Athena-Query don't call unnecessary pages of ` get-query-result ` api.
4345
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+
4473## Release
4574
4675See [ here] ( https://www.notion.so/athena-query-8d4fd5d098b944028dd9c7066a47ffe4#ee977ecfee9840c09e8d7b5a2ed5d3e3 ) . (private)
You can’t perform that action at this time.
0 commit comments