Accessing Snowflake Data
This guide provides an overview of the different options for connecting your Snowflake database to Waii. The guide also discusses the implications of each connection method.
Connection Options
1. Access via Username, Password and Role
This is the most basic way for Waii to access data in your snowflake account. Waii will log onto Snowflake using these credentials to perform both the maintenance of the knowledge graph as well as any required query exeuction. Any communication with Snowflake is encrypted, storage of any user information is encrypted as well.
This requires the least amount of configuration and is often preferred for demos and trials. It can also be effective if Waii is used with a single headless user (powering a specific application, for instance).
To setup an appropriate role follow the guidelines here. To connect Waii to your Snowflake database using a regular username, password, and role, follow the steps described here.
2. Single-sign on (SSO)
SSO avoids the use of passwords and user management within Waii. Instead Waii is using protocols such as oAuth and tokens to identify and authorize users. This is often the preferred way to use Waii in production for enterprise users, but it requires configuration of oAuth and a federated identity provider. This is often considered too complex for trials or demo environments.
To set up SSO follow the guide here.
3. Secure Data Sharing
Secure data sharing allows you give Waii access to a read-only version of the database objects you decide to share. No additional setup is required, Waii handles compute and user management. This is a clean and simple way to share data, especially for trials and demos, but also if your application doesn't need multiple database users in Waii.
The below example is a simple setup of a share. You can identify objects to share via roles and other ways, this documentation has more. Please contact the Waii team to get the actual 'waii_account' to add to the share.
To connect Waii to your Snowflake database using Secure Data Sharing, follow these steps:
- 
Create a Share:
CREATE SHARE waii_share;
GRANT USAGE ON DATABASE your_database TO SHARE waii_share;
GRANT USAGE ON SCHEMA your_schema TO SHARE waii_share;
GRANT SELECT ON ALL TABLES IN SCHEMA your_schema TO SHARE waii_share; - 
Add Waii Account to the Share:
ALTER SHARE waii_share ADD ACCOUNT = 'waii_account';