0.1.0 • Published 5 years ago

avaticajs v0.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

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 => {
      conn.query("select * from table(waylay.timeseries('151CF', 'lightAmbi')) limit 1000").then(
          resultSet => console.log(resultSet)
          conn.close()
      )      
    }).catch(err => {
      console.log("Got error:", err)
})