Skip to content

Commit

Permalink
modify README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
KoteiIto committed Jan 1, 2018
1 parent 29e5f02 commit 6350cfa
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Install with:

## Usage Example

### Create Client
```js
var clientConfig = {
bucketUri: 's3://xxxx'
Expand All @@ -22,24 +23,30 @@ var awsConfig = {

var athena = require("athena-client")
var client = athena.createClient(clientConfig, awsConfig)
```

// receive result by callback
### Receive result by Callback
```js
client.execute('SELECT 1', function(err, data) {
if (err) {
return console.error(err)
}
console.log(data)
})

// receive result by promise
```

### Receive result by Promise
```js
client.execute('SELECT 1').toPromise()
.then(function(data) {
console.log(data)
}).catch(function(err) {
console.error(err)
})
```

// receive result by stream
### Receive result by Stream
```js
var stream = client.execute('SELECT 1').toStream()
stream.on('data', (record) => {
console.log(record)
Expand Down

0 comments on commit 6350cfa

Please sign in to comment.