To query a Snowflake database from inside Workspace, the first step is creating an integration to connect to the database:
- Create a new integration from the Integrations tab on the dashboard (link) or by clicking onin the sidebar when editing a workspace.
- Select "Snowflake".
- Enter the credentials.
Create a Snowflake integration
Workspace will access your database through a set of static IP addresses. You may need to whitelist these addresses in your database's firewall for queries to run successfully.
After creating the integration, you can query the database with a SQL cell. When you're editing a workspace:
- Click "Add SQL cell" at the bottom of the notebook (or on "Add SQL cell" when hovering on the area in between two cells).
- Select the integration that accesses the database you want to query.
- (Optional) Update the variable name of the data frame that will hold the result of your SQL query by updating the field behind "Available as". If you don't set this, the query result will be available as a data frame called
- Write the SQL query.
- Click "Run" in the cell menu (or use the shortcuts).
Example of a running a query against the
Datacamp Snowflake Devintegration. The query result is available as