Skip to content

Commit ff2da85

Browse files
committed
README
1 parent 5ccf6e7 commit ff2da85

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Athena Query
2+
3+
**Athena Query** provide simple interface to get athena query results.
4+
5+
Athena Query wad inspired and forked from [athena-express](https://github.com/ghdna/athena-express#readme).
6+
7+
> **Warning**
8+
> Athena Query support aws-sdk v3 only. So if you use aws-sdk v2, we recommend to use [athena-express](https://github.com/ghdna/athena-express#readme).
9+
10+
## Installation
11+
12+
```
13+
npm install athena-query @aws-sdk/client-athena
14+
```
15+
16+
```
17+
yarn add athena-query @aws-sdk/client-athena
18+
```
19+
20+
## Usage
21+
22+
Athena Query provide [async generator function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function*).
23+
So we can use it with `for await () {}`,
24+
25+
```ts
26+
import { Athena } from "@aws-sdk/client-athena";
27+
import AthenaQuery from "athena-query";
28+
29+
const athena = new Athena({});
30+
const athenaQuery = new AthenaQuery(athena);
31+
32+
for await (const items of athenaQuery.query("SELECT * FROM waf_logs;")) {
33+
console.log(items); // You can get all items with pagination by query.
34+
}
35+
```

0 commit comments

Comments
 (0)