athena-client
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -26,2 +26,6 @@ 'use strict' | ||
options = options || {} | ||
if (typeof(options) == 'function') { | ||
callback = options | ||
options = {} | ||
} | ||
let nowConfig = Object.assign({}, config) | ||
@@ -28,0 +32,0 @@ co(function *() { |
{ | ||
"name": "athena-client", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "a nodejs simple aws athena client", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/KoteiIto/node-athena", |
@@ -62,3 +62,3 @@ athena-client - a nodejs simple aws athena client | ||
### client.execute([_query_], [_options_]) | ||
### client.execute([_query_], [_options_], [_callback_]) | ||
Returns query result. The _options_ can be specified as an object with `timeout` and `format` members such as the following: | ||
@@ -71,2 +71,25 @@ | ||
} | ||
``` | ||
```javascript | ||
client.execute('SELECT 1', function(err, data)) { | ||
if (err) { | ||
return console.error(err) | ||
} | ||
console.log(data) | ||
}) | ||
client.execute('SELECT 1', {timeout: 3000}, function(err, data)) { | ||
if (err) { | ||
return console.error(err) | ||
} | ||
console.log(data) | ||
}) | ||
client.execute('SELECT 1').then(function(data) { | ||
console.log(data) | ||
}).catch(function(err) { | ||
console.error(err) | ||
}) | ||
``` |
@@ -132,2 +132,13 @@ 'use strict' | ||
it('should return success when success to execute query not option (callback)', function(done) { | ||
let mockReqest = getMockRequest() | ||
let client = Client.create(mockReqest, config) | ||
client.execute('query', (err, data) => { | ||
assert.equal(err, null) | ||
assert.equal(data[0].col1, '1') | ||
assert.equal(data[0].col2, '2') | ||
done() | ||
}) | ||
}) | ||
it('should return error when fail to start query (promise)', function(done) { | ||
@@ -134,0 +145,0 @@ new Promise(resolve => { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27572
624
93