Supported warehouses
| Warehouse | Page |
|---|---|
| Postgres | Postgres |
| Google BigQuery | BigQuery |
| Snowflake | Snowflake |
| Databricks (Unity Catalog) | Databricks |
| ClickHouse | ClickHouse |
How connections work
A connection is a credential record stored encrypted in Traffical, scoped to a project. When the pipeline runs:- It looks up the connection.
- It opens a session against your warehouse using the credential.
- It executes the SQL from your assignment and fact definitions against your source tables (read).
- It writes intermediate per-policy materialization tables and staging tables into a designated Traffical schema (read + write).
- It joins and aggregates inside the warehouse — push-down execution for the dialects that support it — then reads small result sets back into Traffical.
- If SDK → warehouse sync is enabled, it also writes
sdk_assignmentsandsdk_trackstables in the Traffical schema. - The session closes.
Permissions
The pipeline needs two kinds of access:- Read on your source tables — wherever your assignment and fact SQL reads from.
- Read + write on a designated Traffical schema — a separate schema/dataset/database that the pipeline owns. Traffical creates tables here, writes to them, and drops them between runs. It never touches your source schemas with anything other than
SELECT.
traffical, analytics_traffical, whatever). Specific commands the pipeline issues there:
CREATE TABLE IF NOT EXISTSfor per-policy materialized data and staging tablesINSERT INTO ... SELECTfor the staging pattern (overlap-window writes)DELETE FROM ... WHERE batch_date >= ...for the overlap-window patternDROP TABLE IF EXISTSfor cleanup
CREATE SCHEMA IF NOT EXISTS / CREATE DATABASE IF NOT EXISTS on first run. For BigQuery, Snowflake, and Databricks the Traffical dataset/schema/catalog must already exist (create it before saving the connection).
Specific permission grants per warehouse are documented on each connector’s page.
Why writes into the warehouse?
It’s the same reason Traffical can be warehouse-native at all: instead of pulling rows up into a separate compute layer to join them, the pipeline does the join inside the warehouse where the data already lives. The intermediate tables are how that happens. They’re disposable — the pipeline re-creates them on each run — but they live in your warehouse so the warehouse’s optimizer can take care of large joins.Setting up a connection
- In the dashboard, open Settings → Warehouse for your project.
- Choose your warehouse type.
- Paste the credentials. They’re encrypted before being stored.
- Click Test connection — Traffical opens a session and runs a trivial query to verify.
- Save.
Cost considerations
The pipeline runs on a schedule. Each run executes the SQL from every active definition. To control cost:- Scope your SQL to a date range. Definitions support
{{start_date}}and{{end_date}}template variables — use them to restrict scans to the window the pipeline asked for, not the whole table. - Use columnar layouts. BigQuery, Snowflake, ClickHouse, and Databricks Delta tables are columnar — scanning fewer columns scans fewer bytes. Postgres benefits less from this.
- Add indexes (Postgres) or partitioning (BigQuery, Snowflake, Databricks). The pipeline’s
WHEREclauses onassigned_atorevent_timeshould hit a partition or index whenever possible.
bytesScanned which you can read in the dashboard’s Pipeline → Runs view. Use it to spot expensive definitions.
SDK → warehouse sync (optional)
If you want SDK events to land in your warehouse too — for ad-hoc analysis, ML pipelines, or compliance — configure it in Settings → SDK sync. The pipeline writes two tables (sdk_assignments, sdk_tracks) into the Traffical schema you’ve already configured for the connection. No separate credentials, no separate destination — same warehouse, same Traffical schema, on a regular cadence.
Troubleshooting
| Symptom | Likely cause |
|---|---|
| ”Connection refused” | Network reachability. Check firewall / IP allowlists — Traffical’s egress IPs are listed in the dashboard. |
| ”Authentication failed” | Wrong credentials, expired key, or insufficient role privileges. |
| ”Permission denied on table X” | Read role doesn’t grant access to that schema/table. |
| ”Query timeout” | SQL takes too long. Scope by date range; add partitioning or indexes. |
| Empty results despite data in the table | Time-window template variables — the SQL probably filters too aggressively for the pipeline’s window. |