Snowflake
ContractHQ can connect directly to your Snowflake account to validate live table schemas and run quality checks. Connection details are stored securely and never logged.
Authentication Options
Least secure. Use only for local development or testing.
RSA private key. No password transmitted over the wire.
Delegate access via your SSO provider (Okta, Azure AD).
Opens a browser window for SSO-based MFA login.
Step 1 — Create a Service User
Create a dedicated Snowflake user for ContractHQ. This keeps audit logs clean and lets you revoke access independently:
-- Create dedicated user and role
CREATE USER contracthq_user
LOGIN_NAME = 'contracthq_user'
DEFAULT_WAREHOUSE = COMPUTE_WH
DEFAULT_ROLE = CONTRACTHQ_ROLE;
CREATE ROLE CONTRACTHQ_ROLE;
GRANT ROLE CONTRACTHQ_ROLE TO USER contracthq_user;Step 2 — Grant Required Privileges
ContractHQ needs USAGE on the warehouse and SELECT on the tables it validates:
-- Warehouse access
GRANT USAGE ON WAREHOUSE COMPUTE_WH TO ROLE CONTRACTHQ_ROLE;
-- Database + schema access
GRANT USAGE ON DATABASE ANALYTICS TO ROLE CONTRACTHQ_ROLE;
GRANT USAGE ON SCHEMA ANALYTICS.RAW TO ROLE CONTRACTHQ_ROLE;
-- Table access (or grant on all tables)
GRANT SELECT ON TABLE ANALYTICS.RAW.USER_SIGNUPS TO ROLE CONTRACTHQ_ROLE;
-- Or: GRANT SELECT ON ALL TABLES IN SCHEMA ANALYTICS.RAW TO ROLE CONTRACTHQ_ROLE;Step 3 — Configure the Connection
Add Snowflake credentials to your contracthq.ymlproject config (use environment variable references — never hardcode credentials):
warehouse:
type: snowflake
account: ${{ env.SNOWFLAKE_ACCOUNT }}
user: ${{ env.SNOWFLAKE_USER }}
private_key_path: ~/.snowflake/rsa_key.p8
database: ANALYTICS
schema: RAW
warehouse: COMPUTE_WH
role: CONTRACTHQ_ROLEStep 4 — Test the Connection
contracthq warehouse test
✔ Connecting to Snowflake (acme.eu-west-1)...
✔ Authenticated as CONTRACTHQ_USER
✔ Warehouse COMPUTE_WH is accessible
✔ Database ANALYTICS is accessible
Connection successful.Controlling Compute Costs
ContractHQ minimises Snowflake credits by using an X-Small warehouse and automatically suspending it after each run. You can override the warehouse size per contract:
warehouse_override:
size: x-small
auto_suspend_seconds: 60