Skip to content
This repository has been archived by the owner on May 10, 2021. It is now read-only.

Latest commit

 

History

History
42 lines (28 loc) · 946 Bytes

README.md

File metadata and controls

42 lines (28 loc) · 946 Bytes

Avatica JS Build Status

JavaScript connector to Calcite Avatica Server

Building

yarn install

Test

yarn test

Generating the protobuf JSON

./node_modules/protobufjs/bin/pbjs -t json  \
    proto/common.proto proto/requests.proto \
    proto/responses.proto  > lib/protobuf_bundle.json      

Example

const connect = require('avaticajs')

connect('http://sql-connector-staging.waylay.io/', apiKey, apiSecret)
  .then(conn => {
    return conn.query("select * from table(waylay.timeseries('151CF', 'lightAmbi')) limit 1000").then(
      resultSet => {
        conn.close()
        console.log(resultSet)
      }
    ).catch(err => {
      conn.close()
      throw err
    })
  }).catch(err => {
    console.log("Got error: ", err)
})