In this guide, we outline the steps required to securely connect your Snowflake database to your Velvet workspace. You may be able to skip some of these steps if you've previously connected your database to other services.
Depending on whether you're starting a new project from scratch, or connecting a database that's already configured for a third-party tool - this will take between 10 minutes and 2 hours.
- Create a read-only user
- Set up a static IP address (guide here)
- Identify and copy your connection string
- Configure which database tables you want to connect with Velvet
It's best practice to create a user with read-only permissions for products like Velvet. Create a user with read-only permissions in Snowflake.
velvet_read_all_data role and grant the necessary privileges. Create a
velvet_readonly user with the password
a very good password and assign them the
- Create a read-only role:
create role if not exists velvet_read_all_data;
- Grant the necessary privileges to the role (code example below).
USAGE on the warehouse to be used for queries.
USAGE on the database and schema with the objects to be accessed.
SELECT on the specific tables or views that can be queried.
GRANT USAGE ON WAREHOUSE your_warehouse_name TO ROLE velvet_read_all_data;
GRANT USAGE ON DATABASE your_database_name TO ROLE velvet_read_all_data;
GRANT USAGE ON SCHEMA your_schema_name TO ROLE velvet_read_all_data;
GRANT SELECT ON ALL TABLES IN SCHEMA your_schema_name TO ROLE velvet_read_all_data;
- Create the
velvet_readonlyuser with the password
a very good password. Assign the
CREATE USER velvet_readonly PASSWORD = 'mypassword';
GRANT ROLE velvet_read_all_data TO USER velvet_readonly;
Snowflake doesn't currently support granting privileges on future tables. You'll need to grant privileges on new tables manually.
Once you've created a read-only user, move on to the next step.
Find your database connection string to paste it into your Velvet workspace config. If you already have a connection string, jump ahead to section #4.
Or, follow the guide below for building your connection string for the first time.
Read our general guide on URI construction here. The Snowflake-specific overview is below.
With Snowflake connection strings, you don't need to percent-encode special characters in the parameters. If special characters cause issues or you want to follow best practices, you can still percent-encode them.
Start with the protocol identifier for a Snowflake connection string:
The protocol identifier is followed by the Snowflake account URL which is the address where your Snowflake account is hosted.
The account URL follows the format:
The is the unique name assigned to your Snowflake account. It's provided by Snowflake when you sign up for an account.
Connection parameters come next. The required parameters are
user which specifies the login name of the user for the connection and
db which specifies the database to use once connected.
You can also include additional parameters to customize the connection. These parameters are appended to the connection string and start with a question mark (
Configure Snowflake as a remote database connection and select which tables you want connected.
- Tap into a workspace in your Velvet dashboard
- Tap "Add a data source"
- Select type "Remote database"
- Name your database
- Paste in your database URI. Note: After providing your database credentials for the first time, we manage the connection using ClickHouse. If required, you can add ClickHouse's Static IPs to an allowlist - Read their API documentation here.
- Select and configure the table you want to connect as a source.
- Name your table and create the source.
- Repeat steps 6 and 7 to add each table you want included as a data source.
- You can now view, search, and filter data inside your database source.
Great job, you’ve connected your internal database as a data source. We’ll capture data from your connected tables so you can query them in your Velvet workspace.
Email [email protected] for support or feedback.
Updated about 2 hours ago