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.

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

Connection Setup

Find Account Identifier

  1. Navigate to your Snowflake dashboard.
  2. Click on your account in the lower left corner.
  3. Click on View account details.
  4. Here you can find your Account Identifier.

Create Security Integration

  1. Navigate to your Snowflake dashboard.
  2. Click on Worksheets.
  3. Click on + to create SQL worksheet.
  4. Paste this into worksheet, just change NAME to the name of your security integration: CREATE SECURITY INTEGRATION NAME TYPE = oauth ENABLED = true OAUTH_CLIENT = custom OAUTH_CLIENT_TYPE = 'CONFIDENTIAL' OAUTH_REDIRECT_URI = 'http://127.0.0.1:5173/callback' OAUTH_ISSUE_REFRESH_TOKENS = TRUE OAUTH_ALLOW_NON_TLS_REDIRECT_URI = true OAUTH_REFRESH_TOKEN_VALIDITY = 86400;
  5. Click on this icon.

Find Client ID and Secret

https://docs.snowflake.com/sql-reference/functions/system_show_oauth_client_secrets

  1. Navigate to your Snowflake dashboard.
  2. Click on Worksheets.
  3. Click on + to create SQL worksheet.
  4. Paste this into worksheet, just change NAME to the name of your security integration: select system$show_oauth_client_secrets(NAME)
  5. Run SQL worksheet.