Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@latitude-data/clickhouse-connector

Package Overview
Dependencies
Maintainers
4
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@latitude-data/clickhouse-connector - npm Package Compare versions

Comparing version 1.1.2 to 2.0.0-next.0

18

CHANGELOG.md
# @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

7

dist/index.d.ts

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc