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

JavaScript binding to Calcite Avatica Server

License

Notifications You must be signed in to change notification settings

waylayio/avatica-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)
})

About

JavaScript binding to Calcite Avatica Server

Resources

License

Stars

Watchers

Forks

Packages

No packages published