Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

presto-client

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

presto-client - npm Package Compare versions

Comparing version 0.0.6 to 0.1.0

8

lib/presto-client/index.js

@@ -23,2 +23,4 @@ var http = require('http');

this.checkInterval = args.checkInterval || QUERY_STATE_CHECK_INTERVAL;
this.jsonParser = args.jsonParser || JSON;
};

@@ -46,2 +48,4 @@

var parser = this.jsonParser;
var req = http.request(opts, function(res){

@@ -57,3 +61,3 @@ var response_code = res.statusCode;

if (response_code < 300 && (data[0] === '{' || data[0] === '[')) {
try { data = JSON.parse(data); }
try { data = parser.parse(data); }
catch (x) {

@@ -163,2 +167,4 @@ /* ignore json parse error (and don't parse) for non-json content body */

throw {message: "schema not specified"};
if (!opts.success && !opts.callback)
throw {message: "callback function 'success' (or 'callback') not specified"};

@@ -165,0 +171,0 @@ var header = {};

2

package.json
{
"name": "presto-client",
"version": "0.0.6",
"version": "0.1.0",
"description": "Distributed query engine Presto client library for node.js",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -58,2 +58,4 @@ # presto-client-node

* interval milliseconds of each RPC to check query status (default: 800ms)
* jsonParser [object]
* custom json parser if required (default: `JSON`)

@@ -158,4 +160,33 @@ return value: client instance object

## BIGINT value handling
Javascript standard `JSON` module cannot handle BIGINT values correctly by precision problems.
```js
JSON.parse('{"bigint":1139779449103133602}').bigint //=> 1139779449103133600
```
If your query puts numeric values in its results and precision is important for that query, you can swap JSON parser with any modules which has `parse` method.
```js
var JSONbig = require('json-bigint');
JSONbig.parse('{"bigint":1139779449103133602}').bigint.toString() //=> "1139779449103133602"
// set client option
var client = new presto.Client({
// ...
jsonParser: JSONbig,
// ...
});
```
## Versions
* 0.1.0:
* add option to pass customized json parser to handle BIGINT values
* add check for required callbacks of query execution
* 0.0.6:
* add API to get/delete queries
* add callback `state` on query execution
* 0.0.5:
* fix to do error check on query execution
* 0.0.4:

@@ -162,0 +193,0 @@ * send cancel request of canceled query actually

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc