How to use clickhouse - 1 common examples

To help you get started, we’ve selected a few clickhouse examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sematext / logagent-js / lib / plugins / output / clickhouse.js View on Github external
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)
}

clickhouse

Client for ClickHouse

Apache-2.0
Latest version published 2 years ago

Package Health Score

47 / 100
Full package analysis

Popular clickhouse functions