> ## Documentation Index
> Fetch the complete documentation index at: https://major-5cc5eebc-docs-bot-mr2qm9w6-typctx.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Snowflake

> Connect to Snowflake and execute SQL queries against your data warehouse.

The `SnowflakeResourceClient` allows you to execute SQL queries against Snowflake databases. It supports async execution, result pagination, and detailed error handling.

## Setup

Create a Snowflake connection using key-pair (JWT) authentication. Configure account, database, schema, warehouse, and role settings per environment, and test connections before saving.

## Usage

```typescript theme={null}
import { mySnowflakeClient } from "./clients";

const result = await mySnowflakeClient.execute(
  "SELECT * FROM users WHERE active = true",
  [],
  "fetch-active-users"
);

if (result.ok) {
  console.log(result.result.rows);
}
```

## Methods

### `execute`

Submit a SQL query for execution.

<ParamField path="sql" type="string" required>
  The SQL query string to execute.
</ParamField>

<ParamField path="params" type="(string | number | boolean | null)[]">
  An array of bind values for the parameterized query.
</ParamField>

<ParamField path="invocationKey" type="string" required>
  A unique identifier for this operation, used for tracing and logging.
</ParamField>

### `status`

Check the status of a long-running query.

### `cancel`

Cancel a running statement.

## Outputs

On success (`ok: true`), the `result` object contains:

<ResponseField name="kind" type="&#x22;database&#x22;">
  Discriminator for the response type.
</ResponseField>

<ResponseField name="rows" type="Record<string, unknown>[]">
  An array of objects representing the rows returned by the query.
</ResponseField>

<ResponseField name="rowsAffected" type="number">
  The number of rows affected by the query.
</ResponseField>
