Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Pitta — Database ClientNew to Visual Studio Code? Get it now.
Pitta — Database Client

Pitta — Database Client

Preview

Dipesh Shrestha

|
5 installs
| (0) | Free
Database client for VS Code: PostgreSQL, MySQL, SQLite, MongoDB, and Redis. Browse and edit visually, or write SQL.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Pitta — Database Client

A database client that lives in VS Code. Browse and edit data in a grid, or write SQL with real completion and diagnostics — both are first-class, and you never leave the editor.

PostgreSQL, MySQL/MariaDB, SQLite, MongoDB, and Redis. MIT licensed, no paid tier, no feature held back.


Getting started

  1. Add a connection. Click the Pitta icon in the activity bar → +, or run Pitta: Add Connection from the command palette. Fill in host, port, database, and user. The password goes to your OS keychain, never to a settings file.
  2. Tag the environment. Every connection is dev, staging, or prod. Production connections are marked in the tree and ask before anything destructive runs.
  3. Browse. Expand the connection → database → schema → table. Click a table to open its data.
  4. Or write a query. Pitta: New Query opens a file in the engine's own language — .sql, .mongodb.js, or .redis. Pick its connection from the status bar at the bottom right, then run with Ctrl+Enter / Cmd+Enter.

Binding a file to a connection

The status bar shows which connection and database the open query file runs against. Click it to change.

For a file that is committed and should always run somewhere specific, put a directive at the top instead — it travels with the file:

-- @pitta connection: orders-staging
-- @pitta database: analytics

select * from orders limit 10;

A directive wins over the status-bar choice, and it is written in whichever comment the file's language uses — --, #, or //.


Running queries

Query mode is not SQL mode: the same commands, shortcuts, history, saved queries and notebooks work for a MongoDB shell file or a Redis command file. Each engine splits its own statements — a Redis line ends at a newline outside quotes, so a value containing one stays a single command.

Action Shortcut
Run the statement under the cursor Ctrl+Enter / Cmd+Enter
Run the selection Ctrl+Shift+Enter / Cmd+Shift+Enter
Run every statement in the file Ctrl+Alt+Enter / Cmd+Alt+Enter
Cancel the running query Ctrl+Shift+C / Cmd+Shift+C

Cancellation is real: it asks the server to stop, rather than abandoning the socket and leaving the query running.

Results arrive per statement, with notices and RAISE output streamed as they happen. Rows come from a server-side cursor, so a million-row result opens as fast as a small one.

Parameters. Write :name in a statement and Pitta prompts for the value, remembering the last one you entered. The value is rewritten to a positional placeholder and bound, never spliced into the SQL, so a saved query cannot be turned into an injection by what someone types at the prompt. A ':literal' inside a string and a ::text cast are left alone.


The data grid

  • Sort and filter from the column headers; both run on the server, so they apply to the whole table and not just the page you have.
  • Search across every column with the filter bar.
  • Edit a cell by double-clicking it. Edits are staged: you see the exact statements — including which key identifies each row — before anything is applied. On a table with no primary key, Pitta offers a physical row id instead and tells you it is doing so.
  • Copy a cell with Ctrl+C / Cmd+C. Double-clicking a read-only cell selects the whole value.
  • Structure tab shows columns, indexes, constraints, triggers, policies, partitions, and statistics.
  • Export the result to CSV, JSON, or JSONL, streamed so a large table does not have to fit in memory. Copy it as TSV, CSV, JSON, Markdown, or SQL INSERT statements.
  • Import a CSV into a table with a column mapping and a conversion preview: Pitta: Import CSV… on a table.
  • Documents in and out. On a MongoDB collection, Pitta: Import Documents… reads a JSON array or NDJSON — the format is read off the file — and Pitta: Export Documents… writes Extended JSON, so an ObjectId comes back an ObjectId rather than {}.
  • Expiry. On a Redis key, Pitta: Set Expiry… sets or clears the TTL. Clearing it is PERSIST, not an expiry of zero.

Values keep their exact form. numeric and int8 never pass through a JavaScript number — not on read, not on write, not on import. A missing field and a NULL stay distinguishable all the way to the grid.


SQL intelligence

Driven by the real PostgreSQL grammar compiled to WebAssembly — the same parser the server uses.

  • Completion of schemas, tables, columns, functions, and keywords. Alias-aware: select o. after from orders o offers that table's columns. Keywords are offered even before a connection is chosen.
  • Hover for a column's type, nullability, default, and comment; for a table, its row estimate and column list.
  • Go to definition on a table opens its DDL. Find references searches the .sql files in your workspace.
  • Diagnostics as you type: syntax errors from the grammar, plus unknown tables and columns checked against the live catalog.
  • Formatting with Shift+Alt+F, or a selection with format-selection. Turn on pitta.editor.formatOnSave to format on save.

All of it works in .sql files and inside SQL notebook cells.

The other dialects

MongoDB and Redis get the same three features from their own drivers, not from a SQL parser pretending:

  • MongoDB shell (.mongodb.js): collections after db., operations after a collection, the collection's own fields inside a filter, and query operators and pipeline stages after $. Fields come from a sample of documents and every suggestion says so — a collection has no declared schema to read. Commands are parsed, never evaluated: nothing in a query file runs as JavaScript.
  • Redis (.redis): the command list comes from the connected server's own COMMAND DOCS, so a module command this build never heard of still completes and still hovers. Keys are deliberately not suggested — a keyspace cannot be listed cheaply, which is the same reason the tree scans in pages.

Beyond the grid

Plans. Run Explain on a statement to get EXPLAIN or EXPLAIN ANALYZE as a diagram, with the expensive nodes flagged and told why they are expensive. EXPLAIN ANALYZE is treated as an execution, because it is one — it runs the statement, so the guards apply.

Schema diagram. Pitta: Show Schema Diagram draws the foreign-key graph of a schema. Drag tables to arrange them; the layout is remembered. Export to SVG or PNG.

Schema compare. Pitta: Compare Schema With… diffs two databases structurally and generates a migration script you review and run like any other SQL.

Server health. Pitta: Server Activity and Health shows live sessions, blocking chains, and a read-only health report. Cancel or terminate a backend without disconnecting yourself.

Notebooks. Pitta: New SQL Notebook creates a .pittabook.sql file — cells of SQL and markdown that serialize to a runnable script, so what you commit is readable in a diff and works without Pitta installed.

History and saved queries. Every executed statement is recorded locally (production excluded by default). Saved queries are plain .sql files in your repository under .pitta/queries, so they are reviewed and versioned like any other code.

Subscriptions. Pitta: Subscribe to Channels streams messages into a panel: PostgreSQL LISTEN/NOTIFY, or Redis pub/sub including the keyspace-notification patterns — offered only when the server is actually configured to emit them.


Engines

PostgreSQL MySQL / MariaDB SQLite MongoDB Redis
Explorer, grid, editing ✓ ✓ ✓ ✓ ✓
Server-side sort ✓ ✓ ✓ ✓ —
Server-side filter ✓ ✓ ✓ ✓ ✓
Streaming cursors ✓ ✓ — ✓ —
Query cancellation ✓ ✓ — ✓ ✓
EXPLAIN / plan view ✓ ✓ — ✓ —
DDL generation ✓ ✓ ✓ ✓ —
Schema diff and migration ✓ — — — —
Session monitor and health ✓ ✓ — ✓ ✓
LISTEN / NOTIFY, pub/sub ✓ — — ✓ ✓
Completion, hover, diagnostics ✓ ✓ ✓ ✓ ✓
SSH tunnel ✓ ✓ — ✓ ✓

Pitta asks each driver what it can do and hides what it cannot, rather than offering a button that fails — and it asks the connection, not just the engine: a standalone MongoDB has no transactions, so the apply dialog says the changes cannot be rolled back instead of promising something that deployment does not do.

PostgreSQL is the deepest supported engine; the others share the same core, the same grid, and the same guards. Every driver is only called supported once it passes the same conformance suite against a real server.

Redis Cluster and MongoDB replica sets are supported, with the caveats each one earns: a cross-slot Redis command is split per node where that is meaningful and refused with the fix where it is not, and an SSH tunnel is refused for a topology that discovers its own nodes, because one forward cannot serve addresses that only resolve on the bastion.


Safety

The rails are on by default, and they read masked SQL — comments and string literals blanked out — so select 'drop table users' is a string and a WHERE inside a subquery is not mistaken for the statement's own.

  • Production confirmation. Destructive statements on a prod connection ask first, quoting the statement back.
  • Unqualified DML blocked. UPDATE or DELETE with no WHERE is refused until you say otherwise.
  • Read-only connections. Every write is refused, DML and DDL alike.
  • EXPLAIN ANALYZE is not a read. It is classified as whatever it will actually run.
  • Credentials in the OS keychain. The shareable connection file format cannot hold a password, so a connection file is safe to commit.
  • Telemetry off. No usage data is collected; the setting exists and defaults to false.

Settings

Everything is under pitta. in your settings. The ones people reach for:

Setting Default What it does
pitta.query.confirmDestructive prod Which environments confirm before a destructive statement
pitta.query.blockUnqualifiedDml true Refuse UPDATE/DELETE with no WHERE
pitta.query.statementTimeoutMs 0 Server-side statement_timeout; 0 disables
pitta.query.autocommit true Run statements outside an explicit transaction
pitta.editor.diagnostics semantic off, syntax, or semantic (adds unknown-name checks)
pitta.editor.completion true Suggest tables, columns, and functions from the connection
pitta.editor.formatOnSave false Format bound .sql files on save
pitta.editor.keywordCase upper Keyword case the formatter produces
pitta.explorer.showSystemObjects false Show pg_catalog and information_schema
pitta.history.excludeEnvironments ["prod"] Environments kept out of query history
pitta.defaultFetchSize 500 Rows fetched per page
pitta.telemetry.enabled false Usage telemetry

Commands

All under the Pitta category in the command palette. The common ones:

  • Add Connection, Edit Connection, Connect, Disconnect
  • New Query, Run Statement, Run Selection, Run All Statements, Cancel Running Query
  • Select Top 100 Rows, Show Structure, Show DDL, Copy Qualified Name
  • Show Schema Diagram, Compare Schema With…, Save Migration As…
  • Server Activity and Health, Query History, Listen for Notifications
  • New SQL Notebook, Export Notebook to SQL, Import CSV…, Save Query
  • Show Logs, Open Diagnostics Panel

Requirements

VS Code 1.90 or newer. Pitta runs in the workspace extension host, so it works over Remote-SSH, WSL, and dev containers — the connection is made from the remote, not from your laptop.

Status

Early development, published as a preview. Surfaces may change before 1.0.

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