Skip to main content

Privileges for Clickhouse Data

This document explains how to create a Clickhouse role to connect Waii to your database.

Waii needs the SELECT privilege on INFORMATION_SCHEMA for access the metadata of the database. It also needs to have SELECT privilege on the database. It essentially gives read access to data which enables Waii to

  • Support detection of constraints, such as primary and foreign keys
  • Analyze variants and string fields with additional structure (e.g., identifying field names in a JSON field or recognizing the format of date strings)
  • Generate statistics for optimized queries
  1. Create a Role and User:

    CREATE ROLE waii_role;
    CREATE USER waii_user IDENTIFIED WITH sha256_password BY 'your_password'
    GRANT waii_role TO waii_user;
  2. Grant Privileges:

     GRANT SELECT ON your_database.* TO waii_role; 
    GRANT SELECT ON INFORMATION_SCHEMA.* TO waii_role;

To verify if the role is configured properly you can run this query.

   SELECT * from INFORMATION_SCHEMA.COLUMNS WHERE table_catalog = 'your_database' 

You should be able to see the names of tables and columns from your database as a result of the query.