Skip to main content

Overview

A Snowflake destination is a reusable connection to a database and schema you own. Unlike an S3 or GCS destination — where Cometly writes Parquet files and you load them yourself — a Snowflake destination has Cometly load the data directly into a table in your warehouse on each run. Your warehouse’s own compute does the load. You give Cometly a role that can create and append to a table in one schema, and a token to authenticate with. Cometly handles the rest.

Prerequisites

  • A Snowflake account, and a role that can create warehouses, databases, roles, users, and network policies (typically ACCOUNTADMIN).
  • A space administrator role in Cometly.

Connect Cometly to Snowflake

1

Create the Snowflake objects

In Snowflake (as a role such as ACCOUNTADMIN), set up:
  • A warehouse for Cometly to run the load on.
  • A database and schema to hold the exported tables.
  • A role that can CREATE TABLE in that schema (grant it USAGE on the warehouse, database, and schema, plus CREATE TABLE on the schema).
  • A network policy — required for a service user’s token to work. Restrict its allowed IPs for production use.
  • A service user (type SERVICE), granted the role above and governed by that network policy.
  • A programmatic access token on that service user, restricted to the role. Copy the token secret — it is shown only once.
2

Find your account identifier

Your account identifier is org-account (with a hyphen) — for example, myorg-ab12345. Use that, not the full https://…snowflakecomputing.com URL.
3

Add the destination in Cometly

In the dashboard, go to Integrations → Snowflake → Add destination and enter:
string
required
A label for this destination, for example “Production warehouse”.
string
required
Your org-account identifier from the query above.
string
required
The warehouse Cometly runs the load on, for example cometly_wh.
string
required
The database that holds the target schema, for example cometly_db.
string
required
The schema Cometly creates the table in, for example exports.
string
required
The role Cometly uses — it must be able to CREATE TABLE in the schema, for example cometly_role.
string
required
The programmatic access token secret from the setup script.
Cometly runs a quick connection check on save. If it succeeds, the destination is connected.
The access token is encrypted at rest and never shown again. Programmatic access tokens expire (DAYS_TO_EXPIRY) — rotate the token in Snowflake and update the destination before then, or the export will start failing.
A service user’s token only works when the user is governed by a network policy (created in the setup script above). Without one, Snowflake rejects the token. Restrict the policy’s ALLOWED_IP_LIST for production use.
Cometly creates each export’s table as the role above, so that role owns it. To let your own reporting roles read the exported tables, grant them access — a one-time future grant covers every table Cometly creates:

Next step

Create an export

Choose this destination, a dataset, a target table name, and a date range.