ByteChef LogoByteChef
Components

Snowflake

Snowflake enables organizations to collaborate, build AI-powered data apps, and unlock data insights—all within a secure and scalable AI Data Cloud.

Snowflake enables organizations to collaborate, build AI-powered data apps, and unlock data insights—all within a secure and scalable AI Data Cloud.

Categories: Analytics

Type: snowflake/v1


Connections

Version: 1

oauth2_authorization_code

Properties

NameLabelTypeDescriptionRequired
account_identifierAccount IdentifierSTRINGAccount identifier of your account.true
clientIdClient IDSTRINGSnowflake OAuth Client ID.true
clientSecretClient SecretSTRINGSnowflake OAuth Client Secret.true

Actions

Delete Row

Name: deleteRow

Delete row from the table.

Properties

NameLabelTypeDescriptionRequired
databaseDatabaseSTRINGtrue
schemaSchemaSTRING
Depends On database
true
tableTableSTRING
Depends On schema, database
true
conditionConditionSTRINGCondition that will be checked in the column. Example: column1=5true

Example JSON Structure

{
  "label" : "Delete Row",
  "name" : "deleteRow",
  "parameters" : {
    "database" : "",
    "schema" : "",
    "table" : "",
    "condition" : ""
  },
  "type" : "snowflake/v1/deleteRow"
}

Output

Type: OBJECT

Properties

NameTypeDescription
resultSetMetaDataOBJECT
Properties {INTEGER(numRows), STRING(format), [STRING($name), STRING($database), STRING($schema), STRING($table), {}($scale), {}($precision), INTEGER($length), STRING($type), BOOLEAN($nullable), INTEGER($byteLength), {}($collation)](rowType), [INTEGER($rowCount), INTEGER($uncompressedSize)](partitionInfo)}
dataARRAY
Items []
codeSTRING
statementStatusUrlSTRING
sqlStateSTRING
statementHandleSTRING
messageSTRING
createdOnDATE
statsARRAY
Items []

Output Example

{
  "resultSetMetaData" : {
    "numRows" : 1,
    "format" : "",
    "rowType" : [ "", "", "", "", { }, { }, 1, "", false, 1, { } ],
    "partitionInfo" : [ 1, 1 ]
  },
  "data" : [ ],
  "code" : "",
  "statementStatusUrl" : "",
  "sqlState" : "",
  "statementHandle" : "",
  "message" : "",
  "createdOn" : "2021-01-01",
  "stats" : [ ]
}

Execute SQL

Name: executeSql

Execute SQL statement.

Properties

NameLabelTypeDescriptionRequired
statementStatementSTRINGSQL statement that will be executed.true

Example JSON Structure

{
  "label" : "Execute SQL",
  "name" : "executeSql",
  "parameters" : {
    "statement" : ""
  },
  "type" : "snowflake/v1/executeSql"
}

Output

Type: OBJECT

Properties

NameTypeDescription
resultSetMetaDataOBJECT
Properties {INTEGER(numRows), STRING(format), [STRING($name), STRING($database), STRING($schema), STRING($table), {}($scale), {}($precision), INTEGER($length), STRING($type), BOOLEAN($nullable), INTEGER($byteLength), {}($collation)](rowType), [INTEGER($rowCount), INTEGER($uncompressedSize)](partitionInfo)}
dataARRAY
Items []
codeSTRING
statementStatusUrlSTRING
sqlStateSTRING
statementHandleSTRING
messageSTRING
createdOnDATE
statsARRAY
Items []

Output Example

{
  "resultSetMetaData" : {
    "numRows" : 1,
    "format" : "",
    "rowType" : [ "", "", "", "", { }, { }, 1, "", false, 1, { } ],
    "partitionInfo" : [ 1, 1 ]
  },
  "data" : [ ],
  "code" : "",
  "statementStatusUrl" : "",
  "sqlState" : "",
  "statementHandle" : "",
  "message" : "",
  "createdOn" : "2021-01-01",
  "stats" : [ ]
}

Insert Row

Name: insertRow

Insert row into the table.

Properties

NameLabelTypeDescriptionRequired
databaseDatabaseSTRINGtrue
schemaSchemaSTRING
Depends On database
true
tableTableSTRING
Depends On schema, database
true
valuesDYNAMIC_PROPERTIES
Depends On table
true

Example JSON Structure

{
  "label" : "Insert Row",
  "name" : "insertRow",
  "parameters" : {
    "database" : "",
    "schema" : "",
    "table" : "",
    "values" : { }
  },
  "type" : "snowflake/v1/insertRow"
}

Output

Type: OBJECT

Properties

NameTypeDescription
resultSetMetaDataOBJECT
Properties {INTEGER(numRows), STRING(format), [STRING($name), STRING($database), STRING($schema), STRING($table), {}($scale), {}($precision), INTEGER($length), STRING($type), BOOLEAN($nullable), INTEGER($byteLength), {}($collation)](rowType), [INTEGER($rowCount), INTEGER($uncompressedSize)](partitionInfo)}
dataARRAY
Items []
codeSTRING
statementStatusUrlSTRING
sqlStateSTRING
statementHandleSTRING
messageSTRING
createdOnDATE
statsARRAY
Items []

Output Example

{
  "resultSetMetaData" : {
    "numRows" : 1,
    "format" : "",
    "rowType" : [ "", "", "", "", { }, { }, 1, "", false, 1, { } ],
    "partitionInfo" : [ 1, 1 ]
  },
  "data" : [ ],
  "code" : "",
  "statementStatusUrl" : "",
  "sqlState" : "",
  "statementHandle" : "",
  "message" : "",
  "createdOn" : "2021-01-01",
  "stats" : [ ]
}

Update Row

Name: updateRow

Update row from the table.

Properties

NameLabelTypeDescriptionRequired
databaseDatabaseSTRINGtrue
schemaSchemaSTRING
Depends On database
true
tableTableSTRING
Depends On schema, database
true
conditionConditionSTRINGCondition that will be checked in the column. Example: column1=5true
valuesDYNAMIC_PROPERTIES
Depends On table
true

Example JSON Structure

{
  "label" : "Update Row",
  "name" : "updateRow",
  "parameters" : {
    "database" : "",
    "schema" : "",
    "table" : "",
    "condition" : "",
    "values" : { }
  },
  "type" : "snowflake/v1/updateRow"
}

Output

Type: OBJECT

Properties

NameTypeDescription
resultSetMetaDataOBJECT
Properties {INTEGER(numRows), STRING(format), [STRING($name), STRING($database), STRING($schema), STRING($table), {}($scale), {}($precision), INTEGER($length), STRING($type), BOOLEAN($nullable), INTEGER($byteLength), {}($collation)](rowType), [INTEGER($rowCount), INTEGER($uncompressedSize)](partitionInfo)}
dataARRAY
Items []
codeSTRING
statementStatusUrlSTRING
sqlStateSTRING
statementHandleSTRING
messageSTRING
createdOnDATE
statsARRAY
Items []

Output Example

{
  "resultSetMetaData" : {
    "numRows" : 1,
    "format" : "",
    "rowType" : [ "", "", "", "", { }, { }, 1, "", false, 1, { } ],
    "partitionInfo" : [ 1, 1 ]
  },
  "data" : [ ],
  "code" : "",
  "statementStatusUrl" : "",
  "sqlState" : "",
  "statementHandle" : "",
  "message" : "",
  "createdOn" : "2021-01-01",
  "stats" : [ ]
}

Additional instructions


After creating you Snowflake account, you have to create SECURITY INTEGRATION. https://docs.snowflake.com/en/sql-reference/sql/create-security-integration-oauth-snowflake

  1. Create SQL Worksheet
  2. Change <name> and <callback url> to fit your application. CREATE SECURITY INTEGRATION <name> TYPE = oauth ENABLED = true OAUTH_CLIENT = custom OAUTH_CLIENT_TYPE = 'CONFIDENTIAL' OAUTH_REDIRECT_URI = '<callback url>' OAUTH_ISSUE_REFRESH_TOKENS = TRUE OAUTH_ALLOW_NON_TLS_REDIRECT_URI = true OAUTH_REFRESH_TOKEN_VALIDITY = 86400;
  3. Run the SQL Worksheet.

To get your Client ID and Client Secret: https://docs.snowflake.com/sql-reference/functions/system_show_oauth_client_secrets

  1. Create SQL Worksheet
  2. Change <name> to name of your security integration: select system$show_oauth_client_secrets( '<name>' )
  3. Run the SQL Worksheet