ClickHouse Integration Guide

Guide to integrating with ClickHouse via Direct Connect.

Steps to Integrate via Direct Connect

  1. Access the SQL Console
    Navigate to the SQL Console to begin the setup process.

  2. Create a User
    Establish a user named KUBIT. The Kubit team will provide a secure password for this user.

    CREATE USER KUBIT IDENTIFIED WITH sha256_password BY '*****';
  3. Define Roles

    • Create a role named KUBIT_R.
      CREATE ROLE OR REPLACE KUBIT_R;
    • Create another role named KUBIT_W.
      CREATE ROLE OR REPLACE KUBIT_W;
  4. Set Up the Database
    Create a database named KUBIT_DB.

    CREATE DATABASE KUBIT_DB;
  5. Assign Permissions
    Grant the KUBIT_W role permissions to read and write within the KUBIT_DB database. This enables the creation of auxiliary tables or views.

    GRANT SELECT, INSERT, ALTER, CREATE, DROP, TRUNCATE, SHOW, CLUSTER ON KUBIT_DB.* TO KUBIT_W;
  6. Configure Read-Only Access
    Provide the KUBIT_R role with read-only (SELECT) permissions for the necessary tables/views and the KUBIT_DB database.

    GRANT SELECT ON KUBIT_DB TO KUBIT_R;
    GRANT SELECT ON table/view TO KUBIT_R;
  7. Set Up IP Address Filters
    Configure IP address filters to include Kubit's IP addresses. You can find the list of IPs to safelist here.

SQL Console Screenshot Database Setup Screenshot
👍

Best Practice
Consider creating additional users, roles, and services for development purposes. This helps isolate production environments and prevent accidental impacts.