@clickhouse/client
Advanced tools
Comparing version 0.2.0-beta1 to 0.2.0
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
import type { ConnBaseQueryParams, Connection, ConnectionParams, ConnExecResult, ConnInsertParams, ConnInsertResult, ConnQueryResult } from '@clickhouse/client-common'; | ||
import type { ConnBaseQueryParams, Connection, ConnectionParams, ConnExecResult, ConnInsertParams, ConnInsertResult, ConnPingResult, ConnQueryResult } from '@clickhouse/client-common'; | ||
import type Http from 'http'; | ||
@@ -44,3 +44,3 @@ import Stream from 'stream'; | ||
private _request; | ||
ping(): Promise<boolean>; | ||
ping(): Promise<ConnPingResult>; | ||
query(params: ConnBaseQueryParams): Promise<ConnQueryResult<Stream.Readable>>; | ||
@@ -47,0 +47,0 @@ exec(params: ConnBaseQueryParams): Promise<ConnExecResult<Stream.Readable>>; |
@@ -231,9 +231,19 @@ "use strict"; | ||
async ping() { | ||
// TODO add status code check | ||
const stream = await this.request({ | ||
method: 'GET', | ||
url: (0, client_common_1.transformUrl)({ url: this.params.url, pathname: '/ping' }), | ||
}); | ||
stream.destroy(); | ||
return true; | ||
try { | ||
const stream = await this.request({ | ||
method: 'GET', | ||
url: (0, client_common_1.transformUrl)({ url: this.params.url, pathname: '/ping' }), | ||
}); | ||
stream.destroy(); | ||
return { success: true }; | ||
} | ||
catch (error) { | ||
if (error instanceof Error) { | ||
return { | ||
success: false, | ||
error, | ||
}; | ||
} | ||
throw error; // should never happen | ||
} | ||
} | ||
@@ -240,0 +250,0 @@ async query(params) { |
export { createConnection, createClient } from './client'; | ||
export { ResultSet } from './result_set'; | ||
/** Re-export @clickhouse/client-common types */ | ||
export { type BaseClickHouseClientConfigOptions, type ClickHouseClientConfigOptions, type BaseQueryParams, type QueryParams, type ExecParams, type InsertParams, type InsertValues, type CommandParams, type CommandResult, type ExecResult, type InsertResult, type DataFormat, type ErrorLogParams, type Logger, type LogParams, type ClickHouseSettings, type MergeTreeSettings, type Row, type ResponseJSON, type InputJSON, type InputJSONObjectEachRow, type BaseResultSet, ClickHouseError, ClickHouseLogLevel, ClickHouseClient, SettingsMap, } from '@clickhouse/client-common'; | ||
export { type BaseClickHouseClientConfigOptions, type ClickHouseClientConfigOptions, type BaseQueryParams, type QueryParams, type ExecParams, type InsertParams, type InsertValues, type CommandParams, type CommandResult, type ExecResult, type InsertResult, type DataFormat, type ErrorLogParams, type Logger, type LogParams, type ClickHouseSettings, type MergeTreeSettings, type Row, type ResponseJSON, type InputJSON, type InputJSONObjectEachRow, type BaseResultSet, type PingResult, ClickHouseError, ClickHouseLogLevel, ClickHouseClient, SettingsMap, } from '@clickhouse/client-common'; |
@@ -1,2 +0,2 @@ | ||
declare const version = "0.2.0-beta1"; | ||
export default version; | ||
declare const _default: "0.2.0"; | ||
export default _default; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const version = '0.2.0-beta1'; | ||
exports.default = version; | ||
exports.default = '0.2.0'; | ||
//# sourceMappingURL=version.js.map |
@@ -5,3 +5,3 @@ { | ||
"homepage": "https://clickhouse.com", | ||
"version": "0.2.0-beta1", | ||
"version": "0.2.0", | ||
"license": "Apache-2.0", | ||
@@ -27,4 +27,4 @@ "keywords": [ | ||
"dependencies": { | ||
"@clickhouse/client-common": "0.2.0-beta1" | ||
"@clickhouse/client-common": "0.2.0" | ||
} | ||
} |
@@ -19,7 +19,8 @@ <p align="center"> | ||
- `@clickhouse/client` - Node.js client, built on top of [HTTP](https://nodejs.org/api/http.html) | ||
- `@clickhouse/client` - a version of the client designed for Node.js platform only. It is built on top of [HTTP](https://nodejs.org/api/http.html) | ||
and [Stream](https://nodejs.org/api/stream.html) APIs; supports streaming for both selects and inserts. | ||
- `@clickhouse/client-browser` - browser client, built on top of [Fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) | ||
- `@clickhouse/client-web` - a version of the client built on top of [Fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) | ||
and [Web Streams](https://developer.mozilla.org/en-US/docs/Web/API/Streams_API) APIs; supports streaming for selects. | ||
- `@clickhouse/common` - shared common types and the base framework for building a custom client implementation. | ||
Compatible with Chrome/Firefox browsers and CloudFlare workers. | ||
- `@clickhouse/client-common` - shared common types and the base framework for building a custom client implementation. | ||
@@ -26,0 +27,0 @@ ## Documentation |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
75191
969
37
2
+ Added@clickhouse/client-common@0.2.0(transitive)
- Removed@clickhouse/client-common@0.2.0-beta1(transitive)