This guide explains how to connect your own ClickHouse to Propel. It works with self-hosted, managed, or ClickHouse Cloud servers.

It covers how to:

  1. Create a user for Propel in your ClickHouse server.
  2. Make sure your ClickHouse is accessible from Propel IPs.
  3. Create a ClickHouse Data Pool in Propel.
  4. Preview and query your data.

Requirements

  • You have a Propel account.
  • You have a ClickHouse Cloud, self-managed, or managed ClickHouse server.
  • A user with SELECT permission on the tables you need to connect.

Step 1: Create a user for Propel in your ClickHouse server

In this section, you’ll set up a user for Propel. Propel will use this user to connect to your ClickHouse instance and query the tables.

1

Create the role 'propel_role'

To create a role for Propel in ClickHouse, execute the SQL statement below.

CREATE ROLE propel_role;
2

Grant necessary permissions

Propel needs to be able to do a SELECT on the tables. You need to grant the “propel_role” role SELECT privileges. You can limit this grant to only the tables you are going to connect to Propel by specifying each table name instead of the ”*”.

GRANT SELECT ON <DATABASE_NAME>.* TO propel_role;

Replace <DATABASE_NAME> with your database name.

3

Create and assign the user

Create the user “propel_user” and assign it the role “propel_role”. You can do this with the following SQL statements:

CREATE USER propel_user IDENTIFIED WITH sha256_password BY '<REPLACE_PASSWORD>';

GRANT propel_role TO propel_user;

Make sure to replace <REPLACE_PASSWORD> with a secure password.

4

Test the user

To ensure your user has the necessary permissions to see and query the tables you need, connect to your ClickHouse using the “propel_user” you just created and run the following statements:

USE DATABASE <DATABASE_NAME>;
SHOW TABLES;

Make sure to replace <DATABASE_NAME> with a secure password. You should see the tables you need to connect to Propel.

Make sure you can query the tables using a SELECT SQL statement.

SELECT * from <TABLE_NAME> LIMIT 10

If you see the records, you are good to go!

Step 2. Make sure your ClickHouse is accessible from Propel IPs

To ensure that Propel can connect to your ClickHouse server, you need to authorize access from the following IP addresses:

3.17.239.162
3.15.73.135
18.219.73.236

2.1 Allowing Propel’s IP in ClickHouse Cloud

If you are using ClickHouse Cloud, go to “Settings” then “IP access list” and click “Add IPs”.

Add the Propel IPs to the list.

Step 3: Create a ClickHouse Data Pool in Propel

1

Go to Data Pools

A Propel Data Pool will represent a table in your ClickHouse server.

Go to the “Data Pools” section of the Console and click “Create Data Pool”.

2

Select ClickHouse

In the new Data Pool page, select “ClickHouse”.

3

Add credentials

Select “Add Credentials”.

Enter your ClickHouse connection details and click “Test Credentials”.

Wait until Propel connects and runs all the tests, then click “Next”.

4

Select tables

Check that Propel has access to all the tables you need, and click “Continue” to finish setting up your first ClickHouse Data Pool.

Select the table and columns you want to connect to Propel and click “Next”.

5

Configure timestamp

Select the primary timestamp of the table and click “Next”.

6

Name your Data Pool

Give your Data Pool a name and a description, and click “Create Data Pool”.

You should see the setup tasks completed successfully, and then you’re all done!

Step 4: Preview and query your data

1

Preview your data

Click on the “Preview Data” tab.

2

Query with SQL

Click the “Playground” section and select “SQL” from the API dropdown.

3

Query with GraphQL

Click the “Playground” section and select “GraphQL” from the API dropdown.