Non-Potable Macchiato

    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

    5

    Version

    0.0.5

    License

    MIT

    Unpacked Size

    7.99 kB

    Total Files

    7

    Last publish

    Collaborators

    • geospock-davidbinns