@clickhouse/client
Advanced tools
Comparing version 0.0.12 to 0.0.13
@@ -57,2 +57,5 @@ /// <reference types="node" /> | ||
abort_signal?: AbortSignal; | ||
/** A specific `query_id` that will be sent with this request. | ||
* If it is not set, a random identifier will be generated automatically by the client. */ | ||
query_id?: string; | ||
} | ||
@@ -59,0 +62,0 @@ export interface QueryParams extends BaseParams { |
@@ -100,2 +100,3 @@ "use strict"; | ||
session_id: this.config.session_id, | ||
query_id: params.query_id, | ||
}; | ||
@@ -102,0 +103,0 @@ } |
@@ -29,3 +29,3 @@ /// <reference types="node" /> | ||
close(): Promise<void>; | ||
private generateQueryId; | ||
private getQueryId; | ||
private logResponse; | ||
@@ -32,0 +32,0 @@ protected getHeaders(params: RequestParams): { |
@@ -222,3 +222,3 @@ "use strict"; | ||
async query(params) { | ||
const query_id = this.generateQueryId(); | ||
const query_id = this.getQueryId(params); | ||
const clickhouse_settings = withHttpSettings(params.clickhouse_settings, this.config.compression.decompress_response); | ||
@@ -245,3 +245,3 @@ const searchParams = (0, http_search_params_1.toSearchParams)({ | ||
async exec(params) { | ||
const query_id = this.generateQueryId(); | ||
const query_id = this.getQueryId(params); | ||
const searchParams = (0, http_search_params_1.toSearchParams)({ | ||
@@ -266,3 +266,3 @@ database: this.config.database, | ||
async insert(params) { | ||
const query_id = this.generateQueryId(); | ||
const query_id = this.getQueryId(params); | ||
const searchParams = (0, http_search_params_1.toSearchParams)({ | ||
@@ -290,6 +290,4 @@ database: this.config.database, | ||
} | ||
// needed for insert queries as the query_id is not generated automatically | ||
// we will use it for `exec` and `insert` methods, but not `select` | ||
generateQueryId() { | ||
return uuid.v4(); | ||
getQueryId(params) { | ||
return params.query_id || uuid.v4(); | ||
} | ||
@@ -296,0 +294,0 @@ logResponse(request, params, response, startTimestamp) { |
@@ -36,2 +36,3 @@ /// <reference types="node" /> | ||
session_id?: string; | ||
query_id?: string; | ||
} | ||
@@ -38,0 +39,0 @@ export interface InsertParams extends BaseParams { |
@@ -1,2 +0,2 @@ | ||
declare const _default: "0.0.12"; | ||
declare const _default: "0.0.13"; | ||
export default _default; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = '0.0.12'; | ||
exports.default = '0.0.13'; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "@clickhouse/client", | ||
"version": "0.0.12", | ||
"version": "0.0.13", | ||
"description": "Official JS client for ClickHouse DB", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
261593
4113