Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

redash-client

JavaScript Client for Redash API

npm version Node.js Version Support build status dependency status License

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:

  1. postQueryResult()
  2. Polling getJob()
  3. Return getQueryResult()

License

MIT License: Teppei Sato <teppeis@gmail.com>

You can’t perform that action at this time.