Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

presto-client-browser

0.0.5 • Public • Published

Presto Client for browsers

GeoSpock Presto REST API client for browsers

Note that Presto must be available with CORS configured. Doing so is out of the scope of this module.

Usage

import PrestoClient from "presto-client-browser";

let prestoClient = new PrestoClient('https://host:port', username, password);
let blocks = [];
let resultColumns = [];
for await (let {state, data, columns} of prestoClient.execute(`
     select * 
     from mytable 
 `)) {
    console.log(state);
    blocks.push(data);
    resultColumns = columns;
}
let rows = [].concat(...blocks);
console.log("Columns:", resultColumns.map(({name}) => name).join(", "));
console.log("Rows:", rows.length);

Keywords

none

Install

npm i presto-client-browser

DownloadsWeekly Downloads

2

Version

0.0.5

License

MIT

Unpacked Size

7.99 kB

Total Files

7

Last publish

Collaborators

  • avatar