Connect Snowflake metadata to Rig

    This connection reads the structure of a Snowflake account: its tables, columns, view definitions and recent SQL history. It never copies rows from your business tables, so Rig can learn how your warehouse is built and queried while the data stays in Snowflake.

    Before you start

    • You need a Snowflake user that can have a public key assigned, and a role that can see the schemas you want to describe.
    • You need a compute warehouse the user may run queries on, and the name of the database to read.
    • Decide which schemas Rig may read. You list them by name when you connect, and Rig stays inside that list.
    • Have OpenSSL or a similar tool ready to generate an RSA key pair.

    Step 1: Set up key-pair authentication in Snowflake

    Rig signs in with a private key, and Snowflake holds the matching public key on the user.

    1. Generate an RSA key pair, following the steps in Snowflake's key-pair authentication guide. Keep the private key file and, if you protected it, its passphrase.
    2. Copy the public key without its header and footer lines.
    3. In Snowflake, assign it to the user with ALTER USER your_user SET RSA_PUBLIC_KEY='MIIBIjANBgkqh...';, using your own key text.
    4. Grant the role you will use access to the compute warehouse, the database and the schemas you want described, as your Snowflake administrator sees fit. Metadata access is enough; Rig does not need to read table rows.
    5. Note your account identifier, user name, warehouse, database and role.

    Keep the private key private
    Paste the private key only into Rig. Anyone with the key and the user name can sign in as that user.

    Step 2: Connect it in Rig

    Adding a source needs a workspace owner, or a role with the Manage connections permission, on a workspace where you manage your own connections. If the Connectors tab says “Data ingestion for this workspace is managed by Rig”, ask an owner or Rig support to add the source.

    1. In Rig, open Connections, choose the Connectors tab and go to Sources & actions.
    2. Search for Snowflake metadata, open the card and click Connect.
    3. Account identifier: Your Snowflake account identifier.
    4. Username: The Snowflake user that holds the public key.
    5. RSA private key (PEM or base64 DER): Paste the private key, either as PEM text or as base64 DER.
    6. Private key passphrase: Optional. Enter it only if you encrypted the private key.
    7. Compute warehouse: The warehouse Rig runs its metadata queries on.
    8. Database: The database to describe.
    9. Allowed schemas (comma-separated): The schemas Rig may read, such as ANALYTICS,MARTS.
    10. Role: Optional. The role to use. Leave it blank to use the user's default role.
    11. History days: The days of SQL history to read. The default is 30, which you can keep.
    12. Max history rows: The cap on history rows Rig reads. The default is 100000, which you can keep.
    13. Click Continue. Rig checks the credentials and lists the streams it can reach, so choose the ones you want and click Connect.
    14. The source then syncs on its schedule, which is nightly unless you change it. To load data straight away, click Sync on its row; Test pulls a small sample first if you want to check the connection.

    What Rig reads

    • Tables: the tables in your allowed schemas.
    • Columns: the columns of those tables, with their types.
    • Views: view definitions for the allowed schemas.
    • Query history: recent SQL run in your account, limited by History days and Max history rows.

    No business rows are copied. Rig reads structure and SQL text only.

    Good to know

    • Query history shows how people already ask questions of your warehouse, which helps Rig pick the right tables and joins. Raise History days if you want a longer window.
    • Rig reads only the schemas you list. Add a schema to the list later to widen what it describes.
    • You can connect more than one Snowflake account or database as separate sources.

    What people use this for

    • Map what is in your Snowflake warehouse
    • Understand how views are built
    • Learn from the SQL your team already runs

    More ideas for using Snowflake metadata

    Was this guide helpful?