How to connect Snowflake to VS Code in PostgreSQL

Galaxy Glossary

How do I connect Snowflake to VS Code?

Use the Snowflake SQL extension in VS Code to authenticate, browse objects, and run queries against your Snowflake warehouse directly from the editor.

Sign up for the latest in SQL knowledge from the Galaxy Team!
Welcome to the Galaxy, Guardian!
Oops! Something went wrong while submitting the form.

Description

What prerequisites do I need?

Install Visual Studio Code (latest), Node.js ≥ 18 for the extension host, and make sure your Snowflake account, role, and warehouse are active and whitelisted for your IP.

How do I install the Snowflake VS Code extension?

Open VS Code ➜ Extensions (⇧⌘X / Ctrl+Shift+X) ➜ search “Snowflake” ➜ click “Snowflake SQL Tools” ➜ Install ➜ Reload Window when prompted.

How do I create a connection profile?

Press F1 ➜ "Snowflake: Add Connection" ➜ enter account, user, role, warehouse, and choose an authType (password, SSO, or key-pair).Save the profile with a descriptive name like dev_ecommerce.

How do I test the connection?

Open Command Palette ➜ "Snowflake: Connect" ➜ pick dev_ecommerce. A status bar icon turns green when authenticated. The Explorer panel now lists databases, schemas, and tables.

How do I run a query against ecommerce data?

Create a new .sql file ➜ type your statement ➜ highlight selection ➜ Run Query (⌘Enter/Ctrl+Enter).Results appear in an editable grid with export buttons.

Can I parameterize and share queries?

Use the Snowflake extension’s ${var} placeholders or switch to Galaxy to store the query in a Collection, add endorsements, and let the AI copilot generate column descriptions.

What best practices should I follow?

Separate dev and prod profiles, use key-pair auth for CI, set QUERY_TAG for observability, and keep the Results panel size small to avoid memory spikes.

Which common errors should I watch out for?

401 “Incorrect username or password” ➜ verify user and authType.390191 “Role not granted” ➜ GRANT usage on the warehouse or switch roles.

Summary & next steps

With the Snowflake SQL extension you can connect, explore objects, and run queries from VS Code. Pair it with Galaxy for AI-assisted SQL, versioning, and team-wide collaboration.

.

Why How to connect Snowflake to VS Code in PostgreSQL is important

How to connect Snowflake to VS Code in PostgreSQL Example Usage


/* Return top-selling products last month */
SELECT p.id,
       p.name,
       SUM(oi.quantity) AS units_sold,
       SUM(oi.quantity * p.price) AS revenue
FROM   OrderItems AS oi
JOIN   Products    AS p ON p.id = oi.product_id
JOIN   Orders      AS o ON o.id = oi.order_id
WHERE  o.order_date BETWEEN DATE_TRUNC('month', CURRENT_DATE) - INTERVAL '1 month'
                         AND DATE_TRUNC('month', CURRENT_DATE) - INTERVAL '1 day'
GROUP  BY p.id, p.name
ORDER  BY revenue DESC
LIMIT  10;

How to connect Snowflake to VS Code in PostgreSQL Syntax


-- Connection profile JSON stored in settings.json
{
  "snowflake.connections": [
    {
      "name": "dev_ecommerce",
      "account": "abc12345.us-east-1",
      "username": "DEV_USER",
      "password": "${env:SNOWFLAKE_PW}",
      "role": "DEVELOPER",
      "warehouse": "DEV_WH",
      "database": "ECOMMERCE",
      "schema": "PUBLIC",
      "authType": "password"
    }
  ]
}

-- Sample query in VS Code
SELECT c.id,
       c.name,
       o.id   AS order_id,
       o.total_amount
FROM   Customers   AS c
JOIN   Orders      AS o ON o.customer_id = c.id
WHERE  o.order_date > CURRENT_DATE - INTERVAL '30 days'
ORDER  BY o.order_date DESC;

Common Mistakes

Frequently Asked Questions (FAQs)

Is the Snowflake VS Code extension free?

Yes, the extension is open-source and free. You only pay normal Snowflake credits for executed queries.

Can I use SSO or Okta?

Choose authType: "externalbrowser" in the connection profile. A browser window opens for Okta or any configured IdP.

How do I switch roles quickly?

Hit F1 ➜ "Snowflake: Switch Role" ➜ pick the desired role. The status bar updates instantly.

Want to learn about other SQL terms?

Trusted by top engineers on high-velocity teams
Aryeo Logo
Assort Health
Curri
Rubie
BauHealth Logo
Truvideo Logo
Welcome to the Galaxy, Guardian!
Oops! Something went wrong while submitting the form.