This is a component for management over Snowflake database on elastic.io platform. Snowflake supports the following constraint types from the ANSI SQL standard:
UNIQUE
PRIMARY KEY
FOREIGN KEY
NOT NULL
Important: - Snowflake supports defining and maintaining constraints, but does not enforce them, except for NOT NULL constraints, which are always enforced. Overview of Snowflake Constraints
It means that:UNIQUE
valuePRIMARY KEY
valueNo required Environment variables.
Before building any flow, you must first create an OAuth 2 integration in Snowflake Worksheets.
Create a new worksheet.
CREATE SECURITY INTEGRATION EIO
TYPE = OAUTH
ENABLED = TRUE
OAUTH_CLIENT = CUSTOM
OAUTH_CLIENT_TYPE = 'CONFIDENTIAL'
OAUTH_REDIRECT_URI = 'https://{your-tenant-address}/callback/oauth2'
OAUTH_ISSUE_REFRESH_TOKENS = TRUE
OAUTH_REFRESH_TOKEN_VALIDITY = 7776000
;
The main fields here are:
{your-tenant-address}
with your own.OAUTH_REFRESH_TOKEN_VALIDITY – The duration for which the component can automatically refresh the token.
❗❗❗Note: By default, the maximum value is 7776000 seconds (90 days). After this period, you must reauthorize the component in Snowflake. If you have a business need to increase the maximum value, request your account administrator to send a request to Snowflake Support.
You can change some values later. For example, to change the OAUTH_REDIRECT_URI, you can use the following query:
ALTER SECURITY INTEGRATION EIO
SET OAUTH_REDIRECT_URI = 'https://{your-tenant2-address}/callback/oauth2';
SELECT SYSTEM$SHOW_OAUTH_CLIENT_SECRETS('EIO');
In response, you will receive the following fields that will be needed for the component:
DESC INTEGRATION EIO;
From this, we will need:
SELECT LOWER(CURRENT_ORGANIZATION_NAME() || '-' || CURRENT_ACCOUNT_NAME());
Now you can create new credentials for the component:
OAuth2
Add New Auth Client
:
OAUTH_CLIENT_ID
here.OAUTH_CLIENT_SECRET
here.OAUTH_AUTHORIZATION_ENDPOINT
or use one of the OAUTH_ALLOWED_AUTHORIZATION_ENDPOINTS
.OAUTH_TOKEN_ENDPOINT
or use one of the OAUTH_ALLOWED_TOKEN_ENDPOINTS
.Scopes (Comma-separated list) (string, required) – Use the following value here: refresh_token session:role:{ROLE}
, where {ROLE}
is the name of the role to interact with Snowflake.
❗Note: The ACCOUNTADMIN
, SECURITYADMIN
, and ORGADMIN
roles are not permitted to use the integration - more info. Ensure that the specified role has access to the necessary database, schema, and table. You can switch to the required role in the Snowflake UI and check the necessary tables.
Snowflake component includes the following actions:
Execute custom query action - Action to execute custom SQL query from provided request string.
Insert action - This action will execute insert query into the specified table.
Lookup row by primary key action - This action will lookup row by it’s primary key
Delete row by primary key action - This action will delete row by it’s primary key
Upsert row by primary key action - This action will execute upsert row by it’s primary key.
Select action -The action will execute an SQL query that can return multiple results.
Execute stored procedure action - This action calls stored procedure
Click here to learn more about the elastic.io iPaaS