Skip to main content


ClickHouse is an open-source, high performance columnar OLAP database management system for real-time analytics using SQL.

Official Website
Network Connection needs

This integration needs network access to the server where the service is running.

See the Network access page for details about how to achieve that.

Credential configuration

Fill it with the appropiate values for your connection. Fill which you need of: host, database, username and password.

In the extra options field you can pass any of the params you can find here.

Here you have an example of a filled credential configuration form in YepCode:

ClickHouse snippets available in editor


The title is the triggering text for YepCode to autocomplete the script


New integration from credential
const clickhouse = yepcode.integration.clickhouse('credential-slug')
New integration from plain authentication data
const { createClient } = require('@clickhouse/client')

const clickhouse = createClient({
host: '',
username: 'playground',
password: 'clickhouse',
database: 'my_database_name'

Execute query

Execute query (promise)
const resultSet = await clickhouse.query({
query: 'SELECT * FROM my_table',
format: 'JSONEachRow',
const dataset = await resultSet.json()
Execute query (stream)
const resultSet = await clickhouse.query({
query: 'SELECT number FROM system.numbers_mt LIMIT 5',
format: 'CSV',
const stream =
stream.on('data', (rows) => {
rows.forEach((row) => {
await new Promise((resolve) => {
stream.on('end', () => {


await clickhouse.insert({
table: 'my_table',
// structure should match the desired format, JSONEachRow in this example
values: [
{ id: 42, name: 'foo' },
{ id: 42, name: 'bar' },
format: 'JSONEachRow',