Connect Snowflake
Streya connects to Snowflake with a dedicated service user assigned a read-only role. Setting this up takes a few GRANT statements.
What you’ll prepare
Section titled “What you’ll prepare”| Item | Example | Notes |
|---|---|---|
| Account identifier | xy12345.us-east-1 | Found in your Snowflake URL or via SELECT CURRENT_ACCOUNT() |
| User | STREYA_USER | Dedicated service user |
| Password | — | Strong, generated password |
| Warehouse | STREYA_WH | The compute warehouse Streya’s queries run on |
| Database | ANALYTICS | The database containing your data |
| Role (optional) | STREYA_READER | Recommended — a role scoped to read-only access |
| Schema (optional) | PUBLIC | Default schema, if you want to set one |
1. Create a role, user, and warehouse
Section titled “1. Create a role, user, and warehouse”Run as ACCOUNTADMIN (or a role with sufficient privileges), adjusting names to your conventions:
-- A dedicated read-only roleCREATE ROLE IF NOT EXISTS STREYA_READER;
-- A dedicated service userCREATE USER IF NOT EXISTS STREYA_USER PASSWORD = '<generate-a-strong-password>' DEFAULT_ROLE = STREYA_READER DEFAULT_WAREHOUSE = STREYA_WH MUST_CHANGE_PASSWORD = FALSE;
GRANT ROLE STREYA_READER TO USER STREYA_USER;
-- Optional: a small dedicated warehouse so Streya's compute-- is isolated and easy to monitor. Reusing an existing one also works.CREATE WAREHOUSE IF NOT EXISTS STREYA_WH WAREHOUSE_SIZE = 'XSMALL' AUTO_SUSPEND = 60 AUTO_RESUME = TRUE;
GRANT USAGE ON WAREHOUSE STREYA_WH TO ROLE STREYA_READER;2. Grant read-only access to your data
Section titled “2. Grant read-only access to your data”GRANT USAGE ON DATABASE ANALYTICS TO ROLE STREYA_READER;GRANT USAGE ON ALL SCHEMAS IN DATABASE ANALYTICS TO ROLE STREYA_READER;GRANT SELECT ON ALL TABLES IN DATABASE ANALYTICS TO ROLE STREYA_READER;GRANT SELECT ON ALL VIEWS IN DATABASE ANALYTICS TO ROLE STREYA_READER;
-- Cover tables created in the futureGRANT SELECT ON FUTURE TABLES IN DATABASE ANALYTICS TO ROLE STREYA_READER;GRANT SELECT ON FUTURE VIEWS IN DATABASE ANALYTICS TO ROLE STREYA_READER;3. Connect it in Streya
Section titled “3. Connect it in Streya”In Streya, go to Workspace settings → Data Warehouse and choose Snowflake, then fill in the connection details:
| Field | Example | Required |
|---|---|---|
| Account | xy12345.us-east-1 | Yes |
| Warehouse | STREYA_WH | Yes |
| Database | ANALYTICS | Yes |
| Schema | PUBLIC | Optional |
| Role | STREYA_READER | Optional |
| Username | STREYA_USER | Yes |
| Password | — | Yes |
Click Connect Data Warehouse. Streya runs a test query and shows the connection status. Your credentials are encrypted and stored in a dedicated secrets manager — see Data connections for how credentials are handled.
Troubleshooting
Section titled “Troubleshooting”Object does not exist or not authorized— the role is missingUSAGEon the database/schema, orSELECTon the table.- Queries hang or fail to start — check the role has
USAGEon the warehouse and the warehouse hasAUTO_RESUME = TRUE. - New tables aren’t visible — add the
FUTURE TABLES/FUTURE VIEWSgrants above, or re-run theALL TABLESgrant.