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 in the appropiate values for your ClickHouse connection. Specify the required fields: host, database, username and password.

In the extra options field, you can include any of the parameter found here.

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

ClickHouse Snippets available in YepCode 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',