presto-client
Advanced tools
Comparing version 0.11.2 to 0.12.0
@@ -18,2 +18,3 @@ var Headers = exports.Headers = function(){ | ||
Headers.SESSION = 'X-Presto-Session'; | ||
Headers.SESSION = 'X-Presto-Prepared-Statement'; | ||
@@ -41,2 +42,3 @@ Headers.USER_AGENT = 'User-Agent'; | ||
TrinoHeaders.SESSION = 'X-Trino-Session'; | ||
TrinoHeaders.PREPARE = 'X-Trino-Prepared-Statement'; | ||
@@ -43,0 +45,0 @@ TrinoHeaders.USER_AGENT = 'User-Agent'; |
@@ -80,11 +80,15 @@ const { URL } = require('url') ; | ||
} else { | ||
// "opts" argument should be an URL, probably nextUri | ||
var href = new URL(opts); | ||
opts = { | ||
method: 'GET', | ||
host: href.hostname, | ||
port: href.port || (href.protocol === 'https:' ? '443' : '80'), | ||
path: href.pathname + href.search, | ||
headers: {}, | ||
}; | ||
try { | ||
// "opts" argument should be an URL, probably nextUri | ||
var href = new URL(opts); | ||
opts = { | ||
method: 'GET', | ||
host: href.hostname, | ||
port: href.port || (href.protocol === 'https:' ? '443' : '80'), | ||
path: href.pathname + href.search, | ||
headers: {}, | ||
}; | ||
} catch (error) { | ||
return callback(error); | ||
} | ||
} | ||
@@ -202,3 +206,7 @@ opts.protocol = client.protocol; | ||
} | ||
if (opts.prepares) { | ||
header[client.headers.PREPARE] = opts.prepares.map((s, index) => 'query' + index + '=' + urlencode(s)).join(','); | ||
} | ||
if (opts.session) | ||
@@ -205,0 +213,0 @@ header[client.headers.SESSION] = opts.session; |
{ | ||
"name": "presto-client", | ||
"version": "0.11.2", | ||
"version": "0.12.0", | ||
"description": "Distributed query engine Presto/Trino client library for node.js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -93,2 +93,5 @@ # presto-client-node | ||
* timezone [string :optional] | ||
* prepares [array(string)] | ||
* The array of prepared queries | ||
* Prepared queries can be referred as `queryN`(N: index) like `query0`, `query1` in the query specified as `query` | ||
* info [boolean :optional] | ||
@@ -95,0 +98,0 @@ * fetch query info (execution statistics) for success callback, or not (default false) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25540
366
237