redash-client
v2.0.0
Published
Redash API Client for JavaScript
Downloads
40
Readme
redash-client
JavaScript Client for Redash API
Note: This pacakge requires Node v8+ for async/await
Install
$ npm install redash-client
Usage
const RedashClient = require('redash-client');
const redash = new RedashClient({
endPoint: 'https://your-redash.com/',
apiToken: 'abcde12345',
});
redash
.queryAndWaitResult({
query: 'select * from actor',
data_source_id: 1,
})
.then(resp => {
console.log(resp.query_result);
});
API
See API document
Supported REST API
#getDataSources()
#getDataSource()
#postQuery()
#getQueries()
#getQuery()
#updateQuery()
#postQueryResult()
#getQueryResult()
#getJob()
Methods for other REST API are not implemented yet. Help!
Utility methods
#queryAndWaitResult()
Internally:
postQueryResult()
- Polling
getJob()
- Return
getQueryResult()
License
MIT License: Teppei Sato <[email protected]>