Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>QuerySmithNew to Visual Studio Code? Get it now.
QuerySmith

QuerySmith

querysmith

|
12 installs
| (2) | Free
SQL workbench for Postgres, MySQL, SQL Server and DuckDB: query, chart, AI optimize, ER diagrams, data models and scheduled SQL pipelines
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

QuerySmith

A SQL workbench inside VS Code. Connect to Postgres, MySQL, SQL Server or DuckDB, browse and run queries, chart results, get AI help tuning queries, draw ER diagrams, design data models, and run multi-step SQL pipelines on a schedule. You don't need a separate desktop app.

Quick start

  1. Click the QuerySmith icon in the activity bar.
  2. Click + (Add Connection), pick an engine and fill in the details. For DuckDB, point it at a .duckdb file.
  3. Open a .sql file and run QuerySmith: Pick Connection to bind it.
  4. Press Cmd+Enter (macOS) or Ctrl+Enter to run. Results open beside the editor.

Connect to DuckDB and run a query

Features

Connections and object explorer

  • One Connections tree for every saved database: databases, schemas, tables, views, functions and procedures.
  • Right-click a table or view to use Select Top 100, Show Columns or Show Relationships.
  • Right-click a database or schema to use Create Schema, Create Table or Drop. Drop actions are grouped separately so you don't click them by accident.
  • On functions and procedures, Show Details lists parameters, and Generate Call writes the invocation SQL for you.
  • You can Edit, Disconnect or Delete a connection from its context menu.

Smith SQL editor

  • .sql files open with Smith SQL highlighting.
  • Run the whole file or a selection with Cmd/Ctrl+Enter, or use the Run button in the editor title bar.
  • Each file remembers its own connection. Switch any time with Pick Connection.

Results grid and charts

  • Results open in a grid panel next to your query.
  • One click turns the result into a chart built on Vega-Lite. QuerySmith recommends a chart type from the shape of your columns.
  • Choose bar, line, area, point, boxplot, pie, histogram and more. Use Simple for quick picks, Explorer to map any column to x, y and color, or Dashboard to see several charts side by side.
  • Recommend charts asks the AI model for chart ideas, and Change model switches providers.
  • History keeps past recommendation runs for the current connection, grouped by provider, so closing the cards doesn't lose them. Open brings a run back.
  • Export the chart as SVG, PNG or a standalone HTML file, or choose Host on Web (live) to serve it at 127.0.0.1 and view it in your browser.

Turn a result into a chart

Query optimization

  • Optimize runs EXPLAIN for the last SELECT and lists concrete tips, such as full scans, missing filters or large sorts.
  • The Plan tab shows the raw query plan, with Refresh and Copy plan.
  • AI rewrite suggests a faster version of the query using OpenAI, Anthropic or a local Ollama model. Choose Local signals only to keep everything offline. Apply to editor replaces your query, or Copy SQL copies it.
  • API keys are stored in VS Code Secret Storage, and you can use OPENAI_API_KEY or ANTHROPIC_API_KEY from the environment instead.

Optimize panel with tips, plan and AI rewrite

ER diagrams

  • Visualize Relationships draws the tables and joins referenced in the current query.
  • Show Relationships on a table shows its foreign-key neighbors.
  • Build ER Diagram… on a schema or database draws the whole thing interactively.
  • Solid lines are declared foreign keys, and dashed lines are joins found in your queries. Use Keys only to hide other columns, Model hints to tag tables as fact, dimension, SCD or append-only, and search, zoom and Fit to navigate large schemas. Recommend model asks the AI to suggest a modeling approach for the diagram.
  • Add objects pulls more tables in. Generate model turns the diagram into a data model, built either by Graph Builder or with AI (AI Augmented).

ER diagram of a star schema

Data models (*.qsmodel.json)

  • New Data Model, New Data Model from Tables… (right-click a schema) or Draft Model with AI….
  • The AI draft supports Kimball (star schema), Inmon (3NF), Data Vault (hubs, links and satellites), or lets the AI choose the best fit.
  • The Graph Builder lets you add tables, columns, types, keys and relationships visually.
  • Preview DDL Plan shows the exact CREATE and ALTER statements before anything runs. Apply Model… executes them against a connection.
  • Seed Data with AI… generates realistic sample rows per table from a scenario you describe.
  • Show Model in ER Diagram renders the model. Model files are validated against a JSON schema as you type.

Steps: SQL pipelines

Split a .sql file into named steps with dependencies:

STEP raw_orders AS
CREATE OR REPLACE TABLE stage.orders AS SELECT * FROM src.orders;

STEP daily_sales DEPENDS ON raw_orders AS
CREATE OR REPLACE TABLE mart.daily_sales AS
SELECT order_date, sum(amount) AS revenue FROM stage.orders GROUP BY 1;
  • Open Steps Panel shows the dependency graph with live status for each step (pending, running, succeeded, failed or skipped).
  • Each step gets Run step and Run from here links right in the editor, and a check mark once it succeeds.
  • Run everything, run from a step, or run only one step. When a step fails, the panel shows the error, the failing statement and the step SQL, with Show in editor, Rerun step and Copy error.
  • Run history keeps each run's trigger, timing and outcome. Show tables in ER diagrams the tables the pipeline built.
  • Right-click any table and choose Add as Pipeline Step to start a pipeline from existing data.
  • Schedule Steps Pipeline saves a cron schedule to .querysmith/pipelines.json. Scheduled runs only happen while VS Code is open, and missed runs are not backfilled.
  • Steps Local API lets scripts trigger runs over HTTP:
    • POST /pipelines/<name>/runs starts a run, and GET /runs/<id> checks it.
    • The API binds to 127.0.0.1 only, requires an Authorization: Bearer <token> header and sends no CORS headers.
    • It's off until you enable it.

Run a Steps pipeline, inspect a failure, rerun

Supported databases

Engine Notes
PostgreSQL Full explorer, EXPLAIN-based optimize
MySQL Full explorer, EXPLAIN-based optimize
SQL Server Full explorer; optimize uses local tips (no query plan yet)
DuckDB Local .duckdb files, read_csv_auto and friends
Snowflake Database / schema / table explorer, declared keys in ER; password, key pair or OAuth token auth; EXPLAIN USING TEXT optimize
Databricks Unity Catalog catalog / schema / table explorer, informational keys in ER; personal access token or OAuth auth; EXPLAIN FORMATTED optimize. Delta, Iceberg and Hudi tables via the catalog
ksqlDB Streams / tables explorer; pull queries, live EMIT CHANGES push queries in Results with Stop; STEP … STREAM deploys persistent queries and SINK appends them into another connection; basic auth / API key
Kafka Topic browser with columns inferred from JSON messages; SELECT … FROM <topic> LIMIT n reads the newest messages, EMIT CHANGES tails live; SASL (plain / SCRAM) and TLS

Settings

Setting Default Description
querysmith.steps.apiPort 7788 Port for the Steps Local API (always 127.0.0.1).
querysmith.charts.recHistoryDays 7 Days to keep chart recommendation history (1 to 14).

Privacy

  • Credentials and API keys are kept in VS Code Secret Storage.
  • Nothing is sent to an AI provider unless you pick one. Ollama and Local signals only keep data on your machine.
  • Live charts and the Steps API only listen on 127.0.0.1.

Requirements

VS Code 1.85 or newer. You need network access to your database server, unless you use DuckDB.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft