Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
chOptions.user = this.config.user
}
if (this.config.password) {
chOptions.password = this.config.password
}
if (this.config.basicAuth !== undefined) {
chOptions.basicAuth = this.config.basicAuth
}
if (this.config.database !== undefined) {
chOptions.config = { database: this.config.database }
}
if (this.config.useGzip !== undefined) {
chOptions.isUseGzip = this.config.useGzip
}
this.ch = new ClickHouse(chOptions)
if (this.config.debug) {
var cfg = this.config
delete cfg.configFile
consoleLogger.log(JSON.stringify(config))
}
this.fields = this.config.fields
this.table = this.config.table
this.data = []
this.ws = this.ch.insert('INSERT INTO ' + this.table).stream()
this.ws.on('error', console.error)
}