smartclickhouse/ts/index.ts
2022-03-02 13:20:18 +01:00

26 lines
593 B
TypeScript

import * as plugins from './smartclickhouse.plugins';
export interface IClickhouseConstructorOptions {
url: string;
port?: number;
}
export class ClickhouseDb {
public options: IClickhouseConstructorOptions;
public clickhouseClient: plugins.clickhouse.ClickHouse;
constructor(optionsArg: IClickhouseConstructorOptions) {
this.options = optionsArg;
}
/**
* starts the connection to the Clickhouse db
*/
public start() {
this.clickhouseClient = new plugins.clickhouse.ClickHouse({
...this.options,
basicAuth: null,
format: 'json'
});
}
}