# Snowflake on boxd

> Snowflake is a cloud-based data warehouse offering elastic scaling, secure data sharing, and SQL analytics across multiple cloud environments.

- Page: https://boxd.sh/integrations/snowflake/
- CLI: `run snowflake` (17 commands, 17 marked common)
- SDK: `import { snowflake } from "@boxd/run"`; every parameter and response type is at `@boxd/run/snowflake`
- Triggers: none
- Connect: `run auth snowflake` (Sign in with Snowflake), or https://app.boxd.sh/integrations/detail/snowflake
- All integrations: https://boxd.sh/integrations/ (Markdown: https://boxd.sh/integrations/index.md)

## From the shell

```sh
run auth snowflake      # once: prints a link to connect your account
run snowflake           # list its commands
run snowflake show-tables
```

Parameters are flags (`--flag value`); object and array parameters take a JSON string. Output is YAML, or JSON with `--json`. Calls use your own connection; `--scope <name>` uses a connection shared with your team.

## From a script

```ts
import { every, snowflake } from "@boxd/run";

every("1 hour", async () => {
  const result = await snowflake.showTables({});
  console.log(result);
});
```

Run it with `run snowflake.run.ts`. Snowflake has no triggers; `every()` polls on a schedule, keeps the script running as a job, and wakes the machine when it is due.

## Commands

Required flags are listed; `run snowflake <command> --help` lists the optional ones. "common" marks what `run snowflake` shows without `--all`.

| Command | SDK method | Required flags | Optional | Description |
|---|---|---|---|---|
| `cancel-statement-execution` ·common | `snowflake.cancelStatementExecution()` | `--statementHandle` | 1 | Cancels the execution of a running SQL statement |
| `check-statement-status` ·common | `snowflake.checkStatementStatus()` | `--statementHandle` | 2 | Retrieves the status and results of a previously submitted SQL statement using its statement handle |
| `drop-warehouse` ·common | `snowflake.dropWarehouse()` | `--name` | 1 | Drops (permanently deletes) a warehouse in Snowflake |
| `execute-sql` ·common | `snowflake.executeSql()` | `--statement` | 7 | Execute SQL statements in Snowflake and retrieve results |
| `fetch-catalog-integration` ·common | `snowflake.fetchCatalogIntegration()` | `--name` | 0 | Retrieves detailed configuration and metadata for a specific catalog integration |
| `get-active-scheduled-maintenances` ·common | `snowflake.getActiveScheduledMaintenances()` | — | 0 | Retrieves a list of any active scheduled maintenances currently in the In Progress or Verifying state |
| `get-all-scheduled-maintenances` ·common | `snowflake.getAllScheduledMaintenances()` | — | 0 | Retrieves a list of the 50 most recent scheduled maintenances, including those in the Completed state |
| `get-component-status` ·common | `snowflake.getComponentStatus()` | — | 1 | Retrieves the status of individual components, each listed with its current status |
| `get-status-rollup` ·common | `snowflake.getStatusRollup()` | — | 0 | Retrieves the status rollup for the entire page, including indicators and human-readable descriptions of the blended component status |
| `get-status-summary` ·common | `snowflake.getStatusSummary()` | — | 0 | Retrieves the current status summary from Snowflake's public status page (status.snowflake.com) |
| `get-unresolved-incidents` ·common | `snowflake.getUnresolvedIncidents()` | — | 0 | Retrieves a list of any unresolved incidents from the Snowflake status page |
| `get-upcoming-scheduled-maintenances` ·common | `snowflake.getUpcomingScheduledMaintenances()` | — | 0 | Retrieves upcoming scheduled maintenances from Snowflake's public status page |
| `show-databases` ·common | `snowflake.showDatabases()` | — | 9 | Lists all databases for which you have access privileges |
| `show-schemas` ·common | `snowflake.showSchemas()` | — | 11 | Lists all schemas for which you have access privileges |
| `show-tables` ·common | `snowflake.showTables()` | — | 12 | Lists all tables for which you have access privileges |
| `submit-sql-statement` ·common ·deprecated | `snowflake.submitSqlStatement()` | `--statement` | 7 | Use ExecuteSql instead |
| `validate-credential` ·common | `snowflake.validateCredential()` | — | 0 | Validates Snowflake credentials by executing a lightweight test query |

## Docs

- [run CLI](https://docs.boxd.sh/cli/run): Call connected integrations from the shell, connect new ones, and run automations.
- [Quickstart](https://docs.boxd.sh/guides/integrations/quickstart): Connect an integration, call it from the shell, and turn a script into an automation.
- [Connections](https://docs.boxd.sh/guides/integrations/connections): Connect an account once, for yourself or for your whole organization.
- [Scripts](https://docs.boxd.sh/guides/automations/scripts): Typed integrations, triggers, schedules and state in a .run.ts file.
- [Jobs](https://docs.boxd.sh/guides/automations/jobs): How a script becomes a background job: states, retries, sleep and wake.
- [Beyond the catalog](https://docs.boxd.sh/guides/automations/beyond-the-catalog): Reach your own APIs, databases and cloud accounts from a script.
