Have ideas to improve npm?Join in the discussion! »

redash-client

2.0.0 • Public • Published

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>

Keywords

Install

npm i redash-client

DownloadsWeekly Downloads

61

Version

2.0.0

License

MIT

Unpacked Size

7.66 kB

Total Files

4

Last publish

Collaborators

  • avatar