Comment on page
Connecting Snowflake database to UI Bakery
To connect your Snowflake database, follow the below steps:
- 1.Go to the Data sources - Connect.
- 2.Select Snowflake from the list of the available sources.
- 3.Specify your credentials and click Test connection.
- 4.When the test connection is successful, click Connect Datasource.
Snowflake configuration screen
Make sure to specify the Role that has access to the required resource
With a password based authentication, all requests to Snowflake are made with the username/password entered during creation. With OAuth, each user will be asked to authenticate Snowflake via OAuth flow to obtain a personal token.
In case of OAuth connection setup, data source credentials will not be shared among UI Bakery users. Each user will be prompted to additionally authenticate themselves with Snowflake during the first usage of the app or when their token expires.
To configure Snowflake OAuth follow the steps bellow:
- 1.Create security integration. Replace UI_BAKERY_REDIRECT_URL with a value from UI Bakery Snowflake configuration screen.
CREATE SECURITY INTEGRATION UIBAKERY
TYPE = OAUTH
ENABLED = TRUE
OAUTH_CLIENT = CUSTOM
OAUTH_CLIENT_TYPE = 'CONFIDENTIAL'
OAUTH_REDIRECT_URI = 'UI_BAKERY_REDIRECT_URL'
2. Find client ID and secret of security integration.
3. Fill client ID and secret fields and click Connect to Snowflake
4. Click Connect Datasource.
Snowflake OAuth configuration example
The first time when users make a request to the datasource, they will be prompted to authenticate themselves with Snowflake.
Updating datasource connection setting will revoke all user token, so they will be asked to authenticate again.
Once you establish the connection, you can interact with the data.
If you need to be able to override the default data source database with a custom value in an action, you can enable the setting Allow override database name in action:
Once enabled, when configuring the action, you will be able to specify the custom database. In case a database is not specified, the default data source database will be used.
To start working with your data, follow the below steps:
- 1.Add a new action, choose your data source, and select the SQL query from the actions list. Specify your query and click Execute action to launch it.
Note that pre-defined actions, such as Load Table, Create Row, etc. are not supported for Snowflake datasource.
2. Check the Result section to make sure the data is loaded.