Integrations / Snowflake
Snowflake
Run SQL against your Snowflake warehouse through the SQL API and check or cancel statements.
3 actions
API key
1 read1 write1 destructive
Calls snowflakecomputing.com
Connect
const conn = await setu.connections.initiate({ userId: "user_1", toolkit: "snowflake" });
console.log(conn.connectUrl); // show this to your user
await conn.waitUntilActive();Permissions requested
This toolkit uses a single credential and requests no scopes.
Actions
Cancel statementwritesnowflake.cancel_statementCancel a Snowflake statement that is still running, by its statement handle.
| Input | Type | Description | |
|---|---|---|---|
statement_handle | string | Required | Statement handle from execute_sql |
await setu.execute({
userId: "user_1",
action: "snowflake.cancel_statement",
input: {
"statement_handle": "<statement_handle>"
},
});Run SQL statementdestructivesnowflake.execute_sqlRun one SQL statement in Snowflake and return its first result partition. The statement may change or delete data, so confirm before running anything but a SELECT. Large queries return a statement handle: poll with get_statement.
| Input | Type | Description | |
|---|---|---|---|
statement | string | Required | The SQL statement to run |
warehouse | string | Optional | Warehouse to use (case-sensitive; default is the user's) |
database | string | Optional | Database to use (case-sensitive) |
schema | string | Optional | Schema to use (case-sensitive) |
role | string | Optional | Role to use (case-sensitive) |
timeout | integer | Optional | Seconds to wait before cancelling the statement |
bindings | object | Optional | Bind variables keyed by position, for example {"1":{"type":"FIXED","value":"123"}} |
await setu.execute({
userId: "user_1",
action: "snowflake.execute_sql",
input: {
"statement": "<statement>"
},
confirm: true,
});Get statement resultreadsnowflake.get_statementCheck a Snowflake statement by its handle: returns the result (or a partition of it) when finished, or the in-progress status.
| Input | Type | Description | |
|---|---|---|---|
statement_handle | string | Required | Statement handle from execute_sql |
partition | integer | Optional | Result partition number to fetch (0 is the first) |
await setu.execute({
userId: "user_1",
action: "snowflake.get_statement",
input: {
"statement_handle": "<statement_handle>"
},
});