@clickhouse/client-common
Advanced tools
Comparing version 1.7.0 to 1.8.0
@@ -21,2 +21,6 @@ import type { BaseClickHouseClientConfigOptions, ClickHouseSettings, ConnExecResult, IsSame, WithClickHouseSummary, WithResponseHeaders } from '@clickhouse/client-common'; | ||
session_id?: string; | ||
/** A specific list of roles to use for this query. | ||
* If it is not set, {@link BaseClickHouseClientConfigOptions.roles} will be used. | ||
* @default undefined (no override) */ | ||
role?: string | Array<string>; | ||
/** When defined, overrides the credentials from the {@link BaseClickHouseClientConfigOptions.username} | ||
@@ -121,2 +125,3 @@ * and {@link BaseClickHouseClientConfigOptions.password} settings for this particular request. | ||
private readonly sessionId?; | ||
private readonly role?; | ||
private readonly logWriter; | ||
@@ -123,0 +128,0 @@ constructor(config: BaseClickHouseClientConfigOptions & ImplementationDetails<Stream>); |
@@ -44,2 +44,8 @@ "use strict"; | ||
}); | ||
Object.defineProperty(this, "role", { | ||
enumerable: true, | ||
configurable: true, | ||
writable: true, | ||
value: void 0 | ||
}); | ||
Object.defineProperty(this, "logWriter", { | ||
@@ -59,2 +65,3 @@ enumerable: true, | ||
this.sessionId = config.session_id; | ||
this.role = config.role; | ||
this.connection = config.impl.make_connection(configWithURL, this.connectionParams); | ||
@@ -87,2 +94,3 @@ this.makeResultSet = config.impl.make_result_set; | ||
session_id: queryParams.session_id, | ||
role: queryParams.role, | ||
query, | ||
@@ -177,2 +185,3 @@ query_id, | ||
session_id: params.session_id ?? this.sessionId, | ||
role: params.role ?? this.role, | ||
auth: params.auth, | ||
@@ -179,0 +188,0 @@ }; |
@@ -66,2 +66,5 @@ import type { ResponseHeaders } from './clickhouse_types'; | ||
session_id?: string; | ||
/** ClickHouse role name(s) to attach to the outgoing requests. | ||
* @default undefined string (no roles) */ | ||
role?: string | Array<string>; | ||
/** @deprecated since version 1.0.0. Use {@link http_headers} instead. <br/> | ||
@@ -68,0 +71,0 @@ * Additional HTTP headers to attach to the outgoing requests. |
@@ -35,2 +35,3 @@ import type { WithClickHouseSummary, WithResponseHeaders } from './clickhouse_types'; | ||
}; | ||
role?: string | Array<string>; | ||
} | ||
@@ -37,0 +38,0 @@ export interface ConnInsertParams<Stream> extends ConnBaseQueryParams { |
@@ -14,4 +14,5 @@ import type { ClickHouseSettings } from '../settings'; | ||
query_id: string; | ||
role?: string | Array<string>; | ||
}; | ||
export declare function toSearchParams({ database, query, query_params, clickhouse_settings, session_id, query_id, }: ToSearchParamsOptions): URLSearchParams; | ||
export declare function toSearchParams({ database, query, query_params, clickhouse_settings, session_id, query_id, role, }: ToSearchParamsOptions): URLSearchParams; | ||
export {}; |
@@ -26,3 +26,3 @@ "use strict"; | ||
// https://stackoverflow.com/questions/812925/what-is-the-maximum-possible-length-of-a-query-string | ||
function toSearchParams({ database, query, query_params, clickhouse_settings, session_id, query_id, }) { | ||
function toSearchParams({ database, query, query_params, clickhouse_settings, session_id, query_id, role, }) { | ||
const params = new URLSearchParams(); | ||
@@ -51,4 +51,14 @@ params.set('query_id', query_id); | ||
} | ||
if (role) { | ||
if (typeof role === 'string') { | ||
params.set('role', role); | ||
} | ||
else if (Array.isArray(role)) { | ||
for (const r of role) { | ||
params.append('role', r); | ||
} | ||
} | ||
} | ||
return params; | ||
} | ||
//# sourceMappingURL=url.js.map |
@@ -1,2 +0,2 @@ | ||
declare const _default: "1.7.0"; | ||
declare const _default: "1.8.0"; | ||
export default _default; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = '1.7.0'; | ||
exports.default = '1.8.0'; | ||
//# sourceMappingURL=version.js.map |
@@ -5,3 +5,3 @@ { | ||
"homepage": "https://clickhouse.com", | ||
"version": "1.7.0", | ||
"version": "1.8.0", | ||
"license": "Apache-2.0", | ||
@@ -8,0 +8,0 @@ "keywords": [ |
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
317746
4451