Snowflake

Query Snowflake data warehouse — execute SQL, manage warehouses, and query metadata via the SQL API.

thinkfleetai f921867 1.1 KB Updated

File contents

Snowflake

Execute SQL queries and manage warehouses via the Snowflake SQL API.

Environment Variables

  • SNOWFLAKE_ACCOUNT - Account identifier (e.g. abc12345.us-east-1)
  • SNOWFLAKE_USER - Username
  • SNOWFLAKE_PASSWORD - Password

Execute SQL

curl -s -X POST \
  "https://$SNOWFLAKE_ACCOUNT.snowflakecomputing.com/api/v2/statements" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $SNOWFLAKE_PASSWORD" \
  -d '{"statement":"SELECT * FROM my_table LIMIT 10","warehouse":"COMPUTE_WH","database":"MY_DB","schema":"PUBLIC"}' | jq '{statementHandle, data: .data[:5]}'

List databases

curl -s -X POST \
  "https://$SNOWFLAKE_ACCOUNT.snowflakecomputing.com/api/v2/statements" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $SNOWFLAKE_PASSWORD" \
  -d '{"statement":"SHOW DATABASES","warehouse":"COMPUTE_WH"}' | jq '.data[]'

Notes

  • SQL API requires key-pair or OAuth auth in production.
  • Always confirm before running DDL or DML statements.

thinkfleetai/thinkfleet-engine/tree/main/skills/snowflake commit f921867f1d

Frequently asked questions

npx skillmds@latest add thinkfleetai/snowflake