Warehouse Connection

Connect your data warehouse so the bot can run SQL queries, explore schemas, and analyze your data. Currently supports Google BigQuery.


Setting Up BigQuery

1. Create a service account

  1. Go to Google Cloud Console → Service Accounts
  2. Select your project
  3. Click Create Service Account
  4. Name it something descriptive (e.g. tvaras-bigquery)
  5. Click Create and Continue

2. Grant permissions

Assign these roles to the service account on your project:

RolePurpose
BigQuery Data ViewerRead tables and views
BigQuery Job UserRun queries
BigQuery Metadata ViewerList datasets and tables

For write operations (creating tables, data output), also grant BigQuery Data Editor.

3. Download the JSON key

  1. Click on the service account you created
  2. Go to Keys tab
  3. Click Add Key → Create new key → JSON
  4. Save the downloaded file

4. Upload in admin panel

  1. Go to Admin → Warehouse
  2. Upload the JSON key file (or paste its contents)
  3. The GCP project ID is auto-extracted from the key
  4. Set the BigQuery location (e.g. US, EU, europe-west1)
  5. Click Save & Connect
  6. Click Test Connection to verify

How It Works

  • The service account JSON key is encrypted before being stored in the database
  • The BigQuery client loads credentials from the database on first use
  • If no database credentials exist, it falls back to the GOOGLE_APPLICATION_CREDENTIALS environment variable
  • Credential changes take effect immediately (no restart needed)

Supported Operations

Once connected, the bot can:

  • Run arbitrary SQL queries against your BigQuery project
  • List all datasets and tables
  • Inspect table schemas (columns, types, descriptions)
  • Export query results as charts, CSVs, or PDFs

Future Support

Support for Snowflake, Amazon Redshift, and Databricks is planned. The warehouse page includes a type selector that will be expanded as new connectors are built.