Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
tr-nestjs-clickhouse
Advanced tools
NodeJS client for ClickHouse. Send query over HTTP interface.
NodeJS client for ClickHouse. Send query over HTTP interface use nestjs-clickhouse library
Yarn
yarn add tr-nestjs-clickhouse
NPM
npm install tr-nestjs-clickhouse --save
Let's register the ClickHouseModule in app.module.ts
import { Module } from '@nestjs/common'
import { ClickHouseModule} from 'tr-nestjs-clickhouse'
@Module({
imports: [
ClickHouseModule.forRoot({
url: 'http://localhost',
port: 8123,
debug: true,
database: 'gettingstarted',
}),
],
})
export class AppModule {}
With Async
import { Module } from '@nestjs/common';
import { RedisModule} from 'nestjs-redis'
@Module({
imports: [
RedisModule.forRootAsync({
useFactory: (configService: ConfigService) => ({
url: 'http://localhost',
port: 8123,
debug: true,
database: 'gettingstarted',
}),
inject:[ConfigService]
}),
],
})
export class AppModule {}
And use in your service
import { Injectable } from '@nestjs/common';
import { ClickHouseRegistry } from 'tr-nestjs-clickhouse';
@Injectable()
export class TestService {
constructor(
private readonly clickHouseRegistry: ClickHouseRegistry
) { }
async query(query: string, reqParams?: any) {
return this.clickHouseRegistry.query(query, reqParams);
}
async insert(query: string, data?: any) {
return this.clickHouseRegistry.insert(query, data);
}
}
Options
export interface ClickHouseOptions {
url?: string;
port?: number;
debug?: boolean;
database?: string;
basicAuth?: BasicAuth;
isUseGzip?: boolean;
trimQuery?: boolean;
usePost?: boolean;
format?: string; // "json" || "csv" || "tsv"
raw?: string;
config?: Config;
reqParams?: ReqParams;
}
type BasicAuth = {
username: string;
password: string;
};
type Config = {
session_id: string;
session_timeout: number;
output_format_json_quote_64bit_integers: number;
enable_http_compression: number;
database: string;
};
type ReqParams = unknown;
That's it!
FAQs
NodeJS client for ClickHouse. Send query over HTTP interface.
The npm package tr-nestjs-clickhouse receives a total of 92 weekly downloads. As such, tr-nestjs-clickhouse popularity was classified as not popular.
We found that tr-nestjs-clickhouse demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.