@latitude-data/clickhouse-connector
Advanced tools
Comparing version 1.1.2 to 2.0.0-next.0
# @latitude-data/clickhouse-connector | ||
## 1.1.2 | ||
## 2.0.0-next.0 | ||
### Major Changes | ||
- 5388504: Pass Source to connectors to get access to source details and also to source manager | ||
This is a breaking change. Before connectors were receiving `rootPath` of their | ||
queries and now this info is obta1ined from the source. | ||
### Patch Changes | ||
- Updated dependencies [155f9e0] | ||
- @latitude-data/base-connector@1.1.2 | ||
- Updated dependencies [9e2dd26] | ||
- Updated dependencies [bd39d29] | ||
- Updated dependencies [aab4a4e] | ||
- Updated dependencies [b95b26d] | ||
- Updated dependencies [26aa69d] | ||
- Updated dependencies [5388504] | ||
- Updated dependencies [a8d4658] | ||
- @latitude-data/source-manager@1.0.0-next.0 | ||
@@ -10,0 +22,0 @@ ## 1.1.1 |
@@ -1,4 +0,5 @@ | ||
import { BaseConnector, CompiledQuery, ResolvedParam } from '@latitude-data/base-connector'; | ||
import { BaseConnector, CompiledQuery, ResolvedParam } from '@latitude-data/source-manager'; | ||
import { ClickHouseSettings } from '@clickhouse/client'; | ||
import QueryResult from '@latitude-data/query_result'; | ||
import { ConnectorOptions } from '@latitude-data/source-manager'; | ||
export type TLSOptions = { | ||
@@ -20,5 +21,5 @@ ca_cert: string; | ||
}; | ||
export default class ClickHouseConnector extends BaseConnector { | ||
export default class ClickHouseConnector extends BaseConnector<ConnectionParams> { | ||
private client; | ||
constructor(rootPath: string, connectionParams: ConnectionParams); | ||
constructor(options: ConnectorOptions<ConnectionParams>); | ||
end(): Promise<void>; | ||
@@ -25,0 +26,0 @@ resolve(value: unknown, id: number): ResolvedParam; |
@@ -1,2 +0,2 @@ | ||
import { BaseConnector, ConnectionError, QueryError } from '@latitude-data/base-connector'; | ||
import { BaseConnector, ConnectionError, QueryError } from '@latitude-data/source-manager'; | ||
import { readFileSync } from 'fs'; | ||
@@ -8,6 +8,6 @@ import { createClient } from '@clickhouse/client'; | ||
client; | ||
constructor(rootPath, connectionParams) { | ||
super(rootPath); | ||
constructor(options) { | ||
super(options); | ||
try { | ||
this.client = createClient(this.buildConnectionParams(connectionParams)); | ||
this.client = createClient(this.buildConnectionParams(options.connectionParams)); | ||
} | ||
@@ -14,0 +14,0 @@ catch (error) { |
{ | ||
"name": "@latitude-data/clickhouse-connector", | ||
"version": "1.1.2", | ||
"version": "2.0.0-next.0", | ||
"license": "LGPL", | ||
@@ -21,3 +21,3 @@ "description": "ClickHouse connector for Latitude", | ||
"@clickhouse/client": "^1.0.1", | ||
"@latitude-data/base-connector": "^1.1.2", | ||
"@latitude-data/source-manager": "^1.0.0-next.0", | ||
"@latitude-data/query_result": "^0.2.0" | ||
@@ -24,0 +24,0 @@ }, |
@@ -23,11 +23,14 @@ import { vi, describe, it, expect, beforeEach } from 'vitest' | ||
it('builds TLS config from provided options', () => { | ||
new ClickHouseConnector('rootPath', { | ||
username: 'user', | ||
password: 'password', | ||
database: 'database', | ||
url: 'http://localhost', | ||
tls: { | ||
ca_cert: 'path/to/ca_cert', | ||
key: 'path/to/key', | ||
cert: 'path/to/cert', | ||
new ClickHouseConnector({ | ||
source: vi.fn(), | ||
connectionParams: { | ||
username: 'user', | ||
password: 'password', | ||
database: 'database', | ||
url: 'http://localhost', | ||
tls: { | ||
ca_cert: 'path/to/ca_cert', | ||
key: 'path/to/key', | ||
cert: 'path/to/cert', | ||
}, | ||
}, | ||
@@ -64,7 +67,10 @@ }) | ||
const connector = new ClickHouseConnector('rootPath', { | ||
username: 'user', | ||
password: 'password', | ||
database: 'database', | ||
url: 'http://localhost', | ||
const connector = new ClickHouseConnector({ | ||
source: vi.fn(), | ||
connectionParams: { | ||
username: 'user', | ||
password: 'password', | ||
database: 'database', | ||
url: 'http://localhost', | ||
}, | ||
}) | ||
@@ -76,3 +82,2 @@ | ||
accessedParams: {}, | ||
config: {}, | ||
}) | ||
@@ -92,7 +97,10 @@ | ||
const connector = new ClickHouseConnector('rootPath', { | ||
username: 'user', | ||
password: 'password', | ||
database: 'database', | ||
url: 'http://localhost', | ||
const connector = new ClickHouseConnector({ | ||
source: vi.fn(), | ||
connectionParams: { | ||
username: 'user', | ||
password: 'password', | ||
database: 'database', | ||
url: 'http://localhost', | ||
}, | ||
}) | ||
@@ -105,3 +113,2 @@ | ||
accessedParams: {}, | ||
config: {}, | ||
}), | ||
@@ -108,0 +115,0 @@ ).rejects.toThrow('query error') |
@@ -7,3 +7,3 @@ import { | ||
QueryError, | ||
} from '@latitude-data/base-connector' | ||
} from '@latitude-data/source-manager' | ||
import { readFileSync } from 'fs' | ||
@@ -14,2 +14,3 @@ import { ClickHouseSettings, createClient } from '@clickhouse/client' | ||
import { NodeClickHouseClient } from '@clickhouse/client/dist/client' | ||
import { ConnectorOptions } from '@latitude-data/source-manager' | ||
@@ -34,10 +35,12 @@ export type TLSOptions = { | ||
export default class ClickHouseConnector extends BaseConnector { | ||
export default class ClickHouseConnector extends BaseConnector<ConnectionParams> { | ||
private client: NodeClickHouseClient | ||
constructor(rootPath: string, connectionParams: ConnectionParams) { | ||
super(rootPath) | ||
constructor(options: ConnectorOptions<ConnectionParams>) { | ||
super(options) | ||
try { | ||
this.client = createClient(this.buildConnectionParams(connectionParams)) | ||
this.client = createClient( | ||
this.buildConnectionParams(options.connectionParams), | ||
) | ||
} catch (error) { | ||
@@ -44,0 +47,0 @@ throw new ConnectionError((error as Error).message) |
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
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
37940
486
2
+ Added@aws-crypto/crc32@5.2.0(transitive)
+ Added@aws-crypto/crc32c@5.2.0(transitive)
+ Added@aws-crypto/sha256-browser@5.2.0(transitive)
+ Added@aws-crypto/sha256-js@5.2.0(transitive)
+ Added@aws-crypto/supports-web-crypto@5.2.0(transitive)
+ Added@aws-crypto/util@5.2.0(transitive)
+ Added@aws-sdk/client-s3@3.717.0(transitive)
+ Added@aws-sdk/client-sso@3.716.0(transitive)
+ Added@aws-sdk/client-sso-oidc@3.716.0(transitive)
+ Added@aws-sdk/client-sts@3.716.0(transitive)
+ Added@aws-sdk/core@3.716.0(transitive)
+ Added@aws-sdk/credential-provider-env@3.716.0(transitive)
+ Added@aws-sdk/credential-provider-http@3.716.0(transitive)
+ Added@aws-sdk/credential-provider-ini@3.716.0(transitive)
+ Added@aws-sdk/credential-provider-node@3.716.0(transitive)
+ Added@aws-sdk/credential-provider-process@3.716.0(transitive)
+ Added@aws-sdk/credential-provider-sso@3.716.0(transitive)
+ Added@aws-sdk/credential-provider-web-identity@3.716.0(transitive)
+ Added@aws-sdk/middleware-bucket-endpoint@3.714.0(transitive)
+ Added@aws-sdk/middleware-expect-continue@3.714.0(transitive)
+ Added@aws-sdk/middleware-flexible-checksums@3.717.0(transitive)
+ Added@aws-sdk/middleware-host-header@3.714.0(transitive)
+ Added@aws-sdk/middleware-location-constraint@3.714.0(transitive)
+ Added@aws-sdk/middleware-logger@3.714.0(transitive)
+ Added@aws-sdk/middleware-recursion-detection@3.714.0(transitive)
+ Added@aws-sdk/middleware-sdk-s3@3.716.0(transitive)
+ Added@aws-sdk/middleware-ssec@3.714.0(transitive)
+ Added@aws-sdk/middleware-user-agent@3.716.0(transitive)
+ Added@aws-sdk/region-config-resolver@3.714.0(transitive)
+ Added@aws-sdk/signature-v4-multi-region@3.716.0(transitive)
+ Added@aws-sdk/token-providers@3.714.0(transitive)
+ Added@aws-sdk/types@3.714.0(transitive)
+ Added@aws-sdk/util-arn-parser@3.693.0(transitive)
+ Added@aws-sdk/util-endpoints@3.714.0(transitive)
+ Added@aws-sdk/util-locate-window@3.693.0(transitive)
+ Added@aws-sdk/util-user-agent-browser@3.714.0(transitive)
+ Added@aws-sdk/util-user-agent-node@3.716.0(transitive)
+ Added@aws-sdk/xml-builder@3.709.0(transitive)
+ Added@bcoe/v8-coverage@1.0.1(transitive)
+ Added@dsnp/parquetjs@1.8.5(transitive)
+ Added@isaacs/cliui@8.0.2(transitive)
+ Added@istanbuljs/schema@0.1.3(transitive)
+ Added@jridgewell/resolve-uri@3.1.2(transitive)
+ Added@jridgewell/trace-mapping@0.3.25(transitive)
+ Added@latitude-data/source-manager@1.1.0(transitive)
+ Added@latitude-data/sql-compiler@1.1.0(transitive)
+ Added@pkgjs/parseargs@0.11.0(transitive)
+ Added@smithy/abort-controller@3.1.9(transitive)
+ Added@smithy/chunked-blob-reader@4.0.0(transitive)
+ Added@smithy/chunked-blob-reader-native@3.0.1(transitive)
+ Added@smithy/config-resolver@3.0.13(transitive)
+ Added@smithy/core@2.5.6(transitive)
+ Added@smithy/credential-provider-imds@3.2.8(transitive)
+ Added@smithy/eventstream-codec@3.1.10(transitive)
+ Added@smithy/eventstream-serde-browser@3.0.14(transitive)
+ Added@smithy/eventstream-serde-config-resolver@3.0.11(transitive)
+ Added@smithy/eventstream-serde-node@3.0.13(transitive)
+ Added@smithy/eventstream-serde-universal@3.0.13(transitive)
+ Added@smithy/fetch-http-handler@4.1.2(transitive)
+ Added@smithy/hash-blob-browser@3.1.10(transitive)
+ Added@smithy/hash-node@3.0.11(transitive)
+ Added@smithy/hash-stream-node@3.1.10(transitive)
+ Added@smithy/invalid-dependency@3.0.11(transitive)
+ Added@smithy/is-array-buffer@2.2.03.0.0(transitive)
+ Added@smithy/md5-js@3.0.11(transitive)
+ Added@smithy/middleware-content-length@3.0.13(transitive)
+ Added@smithy/middleware-endpoint@3.2.7(transitive)
+ Added@smithy/middleware-retry@3.0.32(transitive)
+ Added@smithy/middleware-serde@3.0.11(transitive)
+ Added@smithy/middleware-stack@3.0.11(transitive)
+ Added@smithy/node-config-provider@3.1.12(transitive)
+ Added@smithy/node-http-handler@3.3.3(transitive)
+ Added@smithy/property-provider@3.1.11(transitive)
+ Added@smithy/protocol-http@4.1.8(transitive)
+ Added@smithy/querystring-builder@3.0.11(transitive)
+ Added@smithy/querystring-parser@3.0.11(transitive)
+ Added@smithy/service-error-classification@3.0.11(transitive)
+ Added@smithy/shared-ini-file-loader@3.1.12(transitive)
+ Added@smithy/signature-v4@4.2.4(transitive)
+ Added@smithy/smithy-client@3.5.2(transitive)
+ Added@smithy/types@3.7.2(transitive)
+ Added@smithy/url-parser@3.0.11(transitive)
+ Added@smithy/util-base64@3.0.0(transitive)
+ Added@smithy/util-body-length-browser@3.0.0(transitive)
+ Added@smithy/util-body-length-node@3.0.0(transitive)
+ Added@smithy/util-buffer-from@2.2.03.0.0(transitive)
+ Added@smithy/util-config-provider@3.0.0(transitive)
+ Added@smithy/util-defaults-mode-browser@3.0.32(transitive)
+ Added@smithy/util-defaults-mode-node@3.0.32(transitive)
+ Added@smithy/util-endpoints@2.1.7(transitive)
+ Added@smithy/util-hex-encoding@3.0.0(transitive)
+ Added@smithy/util-middleware@3.0.11(transitive)
+ Added@smithy/util-retry@3.0.11(transitive)
+ Added@smithy/util-stream@3.3.3(transitive)
+ Added@smithy/util-uri-escape@3.0.0(transitive)
+ Added@smithy/util-utf8@2.3.03.0.0(transitive)
+ Added@smithy/util-waiter@3.2.0(transitive)
+ Added@types/istanbul-lib-coverage@2.0.6(transitive)
+ Added@types/node@22.10.3(transitive)
+ Added@types/node-int64@0.4.32(transitive)
+ Added@types/q@1.5.8(transitive)
+ Added@types/readable-stream@4.0.18(transitive)
+ Added@types/thrift@0.10.17(transitive)
+ Added@xterm/xterm@5.5.0(transitive)
+ Added@zenfs/core@1.6.16(transitive)
+ Addedabort-controller@3.0.0(transitive)
+ Addedansi-regex@5.0.16.1.0(transitive)
+ Addedansi-styles@4.3.06.2.1(transitive)
+ Addedasync-limiter@1.0.1(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbase64-js@1.5.1(transitive)
+ Addedbowser@2.11.0(transitive)
+ Addedbrace-expansion@2.0.1(transitive)
+ Addedbrotli-wasm@3.0.1(transitive)
+ Addedbrowser-or-node@1.3.0(transitive)
+ Addedbson@6.8.0(transitive)
+ Addedbuffer@6.0.3(transitive)
+ Addedc8@10.1.3(transitive)
+ Addedcliui@8.0.1(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedconvert-source-map@2.0.0(transitive)
+ Addedcross-spawn@7.0.6(transitive)
+ Addeddotenv@16.4.7(transitive)
+ Addedeastasianwidth@0.2.0(transitive)
+ Addedemoji-regex@8.0.09.2.2(transitive)
+ Addedescalade@3.2.0(transitive)
+ Addedevent-target-shim@5.0.1(transitive)
+ Addedeventemitter3@5.0.1(transitive)
+ Addedevents@3.3.0(transitive)
+ Addedfast-xml-parser@4.4.1(transitive)
+ Addedfind-up@5.0.0(transitive)
+ Addedforeground-child@3.3.0(transitive)
+ Addedget-caller-file@2.0.5(transitive)
+ Addedglob@10.4.5(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedhtml-escaper@2.0.2(transitive)
+ Addedieee754@1.2.1(transitive)
+ Addedint53@1.0.0(transitive)
+ Addedis-fullwidth-code-point@3.0.0(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedisomorphic-ws@4.0.1(transitive)
+ Addedistanbul-lib-coverage@3.2.2(transitive)
+ Addedistanbul-lib-report@3.0.1(transitive)
+ Addedistanbul-reports@3.1.7(transitive)
+ Addedjackspeak@3.4.3(transitive)
+ Addedlocate-path@6.0.0(transitive)
+ Addedlong@5.2.3(transitive)
+ Addedlru-cache@10.4.3(transitive)
+ Addedmake-dir@4.0.0(transitive)
+ Addedminimatch@9.0.5(transitive)
+ Addedminipass@7.1.2(transitive)
+ Addednode-int64@0.4.0(transitive)
+ Addedp-limit@3.1.0(transitive)
+ Addedp-locate@5.0.0(transitive)
+ Addedpackage-json-from-dist@1.0.1(transitive)
+ Addedpath-exists@4.0.0(transitive)
+ Addedpath-key@3.1.1(transitive)
+ Addedpath-scurry@1.11.1(transitive)
+ Addedprocess@0.11.10(transitive)
+ Addedq@1.5.1(transitive)
+ Addedreadable-stream@4.6.0(transitive)
+ Addedrequire-directory@2.1.1(transitive)
+ Addedsafe-buffer@5.1.25.2.1(transitive)
+ Addedsemver@7.6.3(transitive)
+ Addedshebang-command@2.0.0(transitive)
+ Addedshebang-regex@3.0.0(transitive)
+ Addedsignal-exit@4.1.0(transitive)
+ Addedsnappyjs@0.7.0(transitive)
+ Addedstring-width@4.2.35.1.2(transitive)
+ Addedstring_decoder@1.3.0(transitive)
+ Addedstrip-ansi@6.0.17.1.0(transitive)
+ Addedstrnum@1.0.5(transitive)
+ Addedsupports-color@7.2.0(transitive)
+ Addedtest-exclude@7.0.1(transitive)
+ Addedthrift@0.21.0(transitive)
+ Addedtslib@2.8.1(transitive)
+ Addedundici-types@6.20.0(transitive)
+ Addedutilium@1.1.3(transitive)
+ Addeduuid@9.0.1(transitive)
+ Addedv8-to-istanbul@9.3.0(transitive)
+ Addedvarint@6.0.0(transitive)
+ Addedwhich@2.0.2(transitive)
+ Addedwrap-ansi@7.0.08.1.0(transitive)
+ Addedws@5.2.4(transitive)
+ Addedxxhash-wasm@1.1.0(transitive)
+ Addedy18n@5.0.8(transitive)
+ Addedyaml@2.7.0(transitive)
+ Addedyargs@17.7.2(transitive)
+ Addedyargs-parser@21.1.1(transitive)
+ Addedyocto-queue@0.1.0(transitive)
- Removed@latitude-data/base-connector@^1.1.2
- Removed@latitude-data/base-connector@1.1.2(transitive)
- Removed@latitude-data/sql-compiler@0.2.0(transitive)