Skip to content

Connect Snowflake

Streya connects to Snowflake with a dedicated service user assigned a read-only role. Setting this up takes a few GRANT statements.

ItemExampleNotes
Account identifierxy12345.us-east-1Found in your Snowflake URL or via SELECT CURRENT_ACCOUNT()
UserSTREYA_USERDedicated service user
PasswordStrong, generated password
WarehouseSTREYA_WHThe compute warehouse Streya’s queries run on
DatabaseANALYTICSThe database containing your data
Role (optional)STREYA_READERRecommended — a role scoped to read-only access
Schema (optional)PUBLICDefault schema, if you want to set one

Run as ACCOUNTADMIN (or a role with sufficient privileges), adjusting names to your conventions:

-- A dedicated read-only role
CREATE ROLE IF NOT EXISTS STREYA_READER;
-- A dedicated service user
CREATE 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;
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 future
GRANT SELECT ON FUTURE TABLES IN DATABASE ANALYTICS TO ROLE STREYA_READER;
GRANT SELECT ON FUTURE VIEWS IN DATABASE ANALYTICS TO ROLE STREYA_READER;

In Streya, go to Workspace settings → Data Warehouse and choose Snowflake, then fill in the connection details:

FieldExampleRequired
Accountxy12345.us-east-1Yes
WarehouseSTREYA_WHYes
DatabaseANALYTICSYes
SchemaPUBLICOptional
RoleSTREYA_READEROptional
UsernameSTREYA_USERYes
PasswordYes

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.

  • Object does not exist or not authorized — the role is missing USAGE on the database/schema, or SELECT on the table.
  • Queries hang or fail to start — check the role has USAGE on the warehouse and the warehouse has AUTO_RESUME = TRUE.
  • New tables aren’t visible — add the FUTURE TABLES / FUTURE VIEWS grants above, or re-run the ALL TABLES grant.