Skip to main content

Setup

Step 1: Create a dedicated user for ClarityQ

Connect to Snowflake and create a service account:
-- Create a user with the public key authentication
CREATE USER clarityq_user
  RSA_PUBLIC_KEY='<paste-public-key-here>'
  DEFAULT_ROLE = clarityq_role
  COMMENT = 'User for ClarityQ to access specific table';

Step 2: Create and configure a role

Set up appropriate permissions through a dedicated role:
-- Create a dedicated role with limited permissions
CREATE ROLE clarityq_role;

-- Grant SELECT permission on the specific table
GRANT USAGE ON DATABASE ALIEN_EVENTS TO ROLE clarityq_role;
GRANT USAGE ON SCHEMA ALIEN_EVENTS.PUBLIC TO ROLE clarityq_role;
GRANT SELECT ON TABLE ALIEN_EVENTS.PUBLIC.ALIEN_EVENTS TO ROLE clarityq_role;
-- Or grant access to all the tables in the schema
GRANT SELECT ON ALL TABLES IN SCHEMA ALIEN_EVENTS.PUBLIC TO ROLE clarityq_role;

-- Assign the role to the user
GRANT ROLE clarityq_role TO USER clarityq_user;

Step 3: Create a ClarityQ warehouse (or use an existing one)

-- Create or use existing warehouse
CREATE WAREHOUSE IF NOT EXISTS COMPUTE_WH
  WITH WAREHOUSE_SIZE = '{XSMALL | SMALL | MEDIUM | LARGE}'
  AUTO_SUSPEND = 300
  AUTO_RESUME = TRUE;

-- Grant usage permission
GRANT USAGE ON WAREHOUSE COMPUTE_WH TO ROLE CLARITYQ_ROLE;

Step 4: Configure connection in ClarityQ

In the ClarityQ interface, fill out the connection form with the following fields:

Basic Fields (Required for all connections)

  • Connection Name: Choose a name for this connection (e.g., “Production Snowflake”)
  • Account: Your Snowflake account identifier (e.g., xy12345.us-east-1)
  • User: clarityq_user (the user you created in Step 1)
  • Warehouse: Your warehouse name (e.g., COMPUTE_WH)
  • Database: Your database name (e.g., ANALYTICS_DB)
  • DB Schema: Schema name (e.g., public)
  • Role: clarityq_role (the role you created in Step 2)

Authentication Type

Choose your authentication method using the toggle buttons: Password Authentication:
  • Password: Enter the password you set for clarityq_user
Private Key Authentication:
  • Private Key: Paste your RSA private key (multi-line text field) Key-pair authentication setup: For enhanced security, configure RSA key-pair authentication: Generate RSA key pair:
    # Generate private key
    openssl genrsa 2048 | openssl pkcs8 -topk8 -inform PEM -out rsa_key.p8 -nocrypt
    
    # Generate public key
    openssl rsa -in rsa_key.p8 -pubout -out rsa_key.pub
    
    Configure in Snowflake:
    -- Set public key for user
    ALTER USER clarityq_user SET RSA_PUBLIC_KEY='<contents_of_rsa_key.pub>';
    

Connection parameters reference

Required parameters

ParameterTypeDescriptionExample
accountstringSnowflake account identifier with regionxy12345.us-east-1
userstringSnowflake usernameclarityq_user
warehousestringCompute warehouse nameCOMPUTE_WH
databasestringTarget database nameANALYTICS_DB

Optional parameters

ParameterTypeDefaultDescription
connection_namestring-Custom name for this connection
db_schemastringpublicDefault schema within database
rolestring-Snowflake role to use

Authentication methods

Choose one of the following authentication methods:

Password authentication (default)

ParameterTypeDescription
passwordstringUser password

Key-pair authentication

ParameterTypeDescription
private_keystringPrivate key in PEM format