Skip to main content
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

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.
sql
string
required
The SQL query string to execute.
params
(string | number | boolean | null)[]
An array of bind values for the parameterized query.
invocationKey
string
required
A unique identifier for this operation, used for tracing and logging.

status

Check the status of a long-running query.

cancel

Cancel a running statement.

Outputs

On success (ok: true), the result object contains:
kind
"database"
Discriminator for the response type.
rows
Record<string, unknown>[]
An array of objects representing the rows returned by the query.
rowsAffected
number
The number of rows affected by the query.