🐘 NexQL
The PostgreSQL workbench for developers and AI agents
NexQL brings connection management, schema exploration, SQL notebooks, query intelligence, safe database operations, and AI-native workflows into the editor where you already build software: VS Code.
📖 Documentation · 🛒 Marketplace · 🌐 NexQL OSS · 🤝 Contributing · 📝 Changelog
One workbench. Every database moment.
NexQL is designed for the full PostgreSQL workflow—not just sending a query and staring at a result grid.
| Moment | What NexQL gives you |
|---|---|
| Connect | Secure connection storage, SSL, SSH tunnels, environment signals, and compatibility across PostgreSQL-wire databases |
| Explore | A fast database tree for schemas, tables, views, functions, types, roles, extensions, and foreign data wrappers |
| Query | Native .pgsql notebooks, completion, saved queries, result streaming, export, and keyboard-first execution |
| Understand | EXPLAIN CodeLens, query history, table intelligence, index usage, activity monitoring, and visual result analysis |
| Operate | Guarded CRUD and DDL workflows, maintenance commands, transactions, object definition viewers, and migration-friendly SQL |
| Extend | AI assistance and MCP tools that ground compatible agents in the live database while keeping execution human-approved |
Built for real database work
- Schema and application development — inspect objects, write repeatable notebook workflows, and move from a failing query to a tested fix.
- Production investigation — distinguish environments at a glance, inspect activity and locks, profile tables, and diagnose regressions without leaving VS Code.
- Performance engineering — run EXPLAIN workflows, review plan shape, inspect index usage, and keep query history close to the code that caused it.
- Data exploration — filter, transpose, inspect column statistics, stream large results, create charts, and export only what you need.
- AI-assisted engineering — generate, explain, optimize, and analyze SQL with schema-aware context; connect MCP-capable agents to safe live database tools.
NexQL is built around a simple principle: make database work feel like software work—contextual, reviewable, repeatable, and close to the code.
📺 See the workflow
The NexQL website includes an interactive VS Code workbench demo covering the complete product loop:
- Connect to a database and orient yourself in its schema.
- Write and execute SQL in a native notebook.
- Ask AI for schema-grounded help when the problem is ambiguous.
- Inspect plans, activity, results, and performance signals.
- Make a controlled change with the right environment context.
✨ Capability map
Connection and environment safety
- Credentials stored with VS Code SecretStorage encryption.
- Environment tagging for PROD, STAGING, and DEV.
- Read-only mode, risk scoring, confirmation prompts, and configurable Auto-LIMIT protection.
- SSL modes, CA certificates, SSH tunneling, and PostgreSQL-compatible cloud connection support.
- Pooler-aware guidance for services such as Neon and Supabase.
A database explorer that stays close to your code
- Browse databases, schemas, tables, views, materialized views, functions, procedures, aggregates, types, roles, extensions, sequences, triggers, partitions, publications, event triggers, tablespaces, and FDWs.
- Open object definitions as readable SQL with copy, edit, and routine scaffolding workflows.
- Create and modify tables with a visual designer where available.
- Manage indexes and constraints without losing the underlying SQL.
- Drag tables, columns, functions, notebooks, and saved queries into the SQL Assistant as context.
Notebooks, results, and reusable knowledge
- Native
.pgsqlnotebooks with persistent cells, rich output, completions, and execution history. - Saved query library with tags, connection context restoration, in-place editing, and optional AI-generated metadata.
- Result grids with filtering, column statistics, transpose view, structured in-grid editing, and explicit commit confirmation.
- Sliding-window streaming for large
SELECTresults. - Configurable
bytearendering for hex, PostgreSQL, and JSON-debug workflows. - Export results to CSV, JSON, or Excel.
- One-click charts for bar, line, area, pie, doughnut, and scatter exploration.
Performance and operational intelligence
- EXPLAIN CodeLens directly from notebook cells.
- Historical query execution tracking with degradation signals.
- Table profiles covering size, statistics, activity, index usage, and bloat indicators.
- Live activity monitoring with lock/wait status and health-focused telemetry cards.
- Index and constraint management, plus schema search and migration-oriented workflows.
AI and agent connectivity
- Natural language to SQL with live schema context.
- Query explanation, optimization guidance, error translation, and result-set analysis.
- Multiple SQL Assistant tabs for parallel investigations.
- Provider flexibility: NexQL Free AI, GitHub Models, GitHub Copilot/VS Code LM, OpenAI, Anthropic, Gemini, Ollama, LM Studio, and custom OpenAI-compatible endpoints.
- Built-in MCP integration for schema discovery, safe
SELECT, EXPLAIN, join-path inference, table statistics, and index usage. - The default AI workflow is notebook-first: AI proposes SQL, you review it, and you choose when to execute it.
Core, Pro, and the product you install
NexQL uses an open-core architecture:
- NexQL Core is this MIT-licensed repository. It contains the open-source extension foundation, connection and explorer workflows, notebooks, database operations, safety primitives, testing infrastructure, and extension seams.
- NexQL Pro is the published Marketplace/Open VSX build. It layers premium product capabilities—including AI chat, MCP, dashboard, Plan Studio, backup and restore, visual schema design, and database indexing—on top of Core.
- Both distributions are built from the same product direction. Core is intentionally usable on its own and intentionally extensible.
This distinction matters when building locally: a Core checkout produces the free/OSS build unless a sibling packages/pro checkout is present.
📋 Capability and availability matrix
| Area | Core / OSS | Marketplace / Pro |
|---|---|---|
| Secure connections, SSL, SSH, and environment signals | ✅ | ✅ |
| Database explorer and PostgreSQL object operations | ✅ | ✅ |
| SQL notebooks, completions, saved queries, and exports | ✅ | ✅ |
| Query safety, read-only mode, Auto-LIMIT, and confirmation flows | ✅ | ✅ |
| EXPLAIN workflows, result tooling, and core performance services | ✅ | ✅ |
| AI chat and provider integrations | Extension seam | ✅ |
| Live monitoring dashboard | Extension seam | ✅ |
| MCP server and agent tools | Extension seam / bundled integration points | ✅ |
| Backup and restore | — | ✅ |
| Database indexing and semantic grounding | — | ✅ |
| Plan Studio and visual schema designer | — | ✅ |
The exact premium surface evolves with the published build. See CHANGELOG.md and the NexQL website for the current product surface.
🌐 PostgreSQL, wherever it runs
NexQL speaks the PostgreSQL wire protocol, so it works with self-hosted databases, local containers, managed services, and compatible distributed systems.
| Platform | Status | Connection note |
|---|---|---|
| PostgreSQL 12–17 | ✅ Supported | Integration-tested across the supported release range |
| Neon | ✅ Works | Prefer the direct, non-pooler endpoint with SSL require |
| Supabase | ✅ Works | Use direct or session pooler connections; avoid transaction pooler for interactive sessions |
| TimescaleDB / Timescale Cloud | ✅ Compatible | PostgreSQL extension compatibility |
| YugabyteDB (YSQL) | ✅ Mostly compatible | Use port 5433; capability-gated features fall back when needed |
| AWS RDS / Aurora | ✅ Works | Use the provider’s SSL requirements |
| Google Cloud SQL / AlloyDB | ✅ Works | Use the provider’s SSL requirements |
| Azure Database for PostgreSQL Flexible Server | ✅ Works | Set SSL mode to require or stronger |
See docs/COMPATIBILITY.md for the detailed matrix, provider-specific settings, and caveats.
🚀 Quick start
Install the published extension
# From VS Code
ext install ric-v.postgres-explorer
# Or from a terminal
code --install-extension ric-v.postgres-explorer
Then open the PostgreSQL activity-bar view, choose Add Connection, enter your details, and connect.
Your first useful loop
- Add a connection and label its environment.
- Expand a schema and open a table or function.
- Open a
.pgsqlnotebook and write a query. - Use Ctrl+Enter to execute the current cell.
- Save the query with its connection and schema context.
- Use EXPLAIN, table intelligence, or result analysis when the question becomes a performance question.
Keyboard shortcuts
| Shortcut | Action |
|---|---|
Ctrl+Enter |
Execute the current cell |
Shift+Enter |
Execute and move to the next cell |
F5 |
Refresh the current item |
Ctrl+Shift+P |
Open the Command Palette |
💾 Saved queries: turn investigations into reusable knowledge
Saved Queries preserves the context that usually gets lost after a database investigation:
- Tag-based organization — group queries by topic such as analytics, maintenance, or daily reports.
- Connection context — remember the original connection, database, and schema.
- One-click reopening — restore the query in a notebook with its original context.
- In-place editing — update title, description, tags, and SQL without creating duplicates.
- Optional AI metadata — generate titles, descriptions, and tags when the published AI surface is enabled.
Typical workflow:
- Use the Save Query CodeLens action on a notebook cell.
- Add a title, description, and tags.
- Reopen it from the Saved Queries tree when the investigation returns.
- Edit it in place as the schema or operational question evolves.
🛠️ Database operations at a glance
NexQL keeps common administration actions discoverable while preserving the SQL underneath:
| Object | Operations |
|---|---|
| Tables | View, edit, insert, update, delete, truncate, drop, VACUUM, ANALYZE, REINDEX |
| Views | View definition, edit, query data, drop |
| Materialized views | Refresh, view data, edit, drop |
| Functions and procedures | View, edit, call with parameters, drop |
| Types and domains | View properties, edit, drop |
| Foreign data wrappers | Create/drop servers, user mappings, import schema |
| Foreign tables | View, edit, drop |
| Extensions | Enable, disable, drop |
| Roles | Grant/revoke permissions, edit, drop |
The available operation set is capability-aware and may vary by PostgreSQL version, permissions, and compatible platform.
🤖 AI and MCP: capability without blind execution
NexQL treats AI as a database-aware collaborator, not an unattended production operator.
NexQL Free AI
The published product offers a zero-configuration managed provider:
- Smart — everyday query generation, explanations, and schema help.
- Engineer — deeper optimization and migration support.
- Architect — advanced database engineering workflows.
Availability, quotas, and pricing can change; use AI Settings and the current Marketplace listing for the latest details.
Bring your own provider
Configure NexQL to use GitHub Models, GitHub Copilot/VS Code LM, OpenAI, Anthropic, Gemini, Ollama, LM Studio, or a custom OpenAI-compatible endpoint. Provider configuration is exposed through postgresExplorer.ai.chat.provider and NexQL: Open AI Settings.
MCP for compatible agents
The published product can expose live, read-focused database tools to GitHub Copilot, Cursor, Claude Desktop, Codex, and other MCP-compatible clients:
- Discover schemas and objects.
- Describe objects and search schema metadata.
- Run safe
SELECTstatements. - Explain queries.
- Infer join paths.
- Inspect table statistics and index usage.
By default, VS Code can spawn the bundled nexql-mcp binary through stdio. For external clients, NexQL also supports an optional fixed port and SecretStorage-backed bearer token. SSH-tunneled connections are intentionally excluded from ephemeral MCP profiles; managed TLS profiles carry the relevant certificate settings.
Configure MCP from NexQL Settings → Preferences. Use postgresExplorer.mcp.binaryPath to override binary resolution when debugging or packaging.
Safe execution model
- Ask — you describe the goal or trigger an analysis.
- Ground — NexQL supplies selected live schema or result context.
- Propose — AI produces SQL, an explanation, or an optimization path.
- Review — you inspect the generated content in chat or a notebook.
- Execute — you explicitly run the cell when you are ready.
No query is executed automatically by the notebook-first AI workflow.
🔒 Privacy and telemetry
NexQL ships a privacy-first telemetry client for anonymous product analytics:
- SQL text, schema and object names, hostnames, database names, usernames, and credentials are not collected.
- VS Code’s global telemetry setting is a hard gate; when disabled globally, NexQL telemetry is disabled.
- Event payloads are allowlisted and bucketed, including durations and result sizes, to avoid raw sensitive values.
Configure telemetry
Set these in VS Code settings:
postgresExplorer.telemetry.mode:off | basic | detailed— default:basicpostgresExplorer.telemetry.allowUsage: anonymous usage counters — default:truepostgresExplorer.telemetry.allowPerformance: anonymized performance buckets — default:false
Optional PostHog sink
postgresExplorer.telemetry.posthogHost: defaults tohttps://us.i.posthog.compostgresExplorer.telemetry.posthogApiKey: your PostHog project key
If posthogApiKey is empty, telemetry remains local through the debug sink.
Tracked event families include lifecycle, feature usage, connection outcomes, query success/failure with coarse buckets, and provider-level AI outcomes.
📚 Documentation map
README.md— product overview, architecture, installation, development, and troubleshootingMARKETPLACE.md— concise Marketplace-facing product descriptiondocs/COMPATIBILITY.md— platform compatibility matrix and provider caveatsdocs/ARCHITECTURE.md— system architecture and component/data-flow detailsdocs/STYLING_GUIDE.md— centralized styling and UI refactoring patternsdocs/TESTING.md— test strategy and execution notesSECURITY.md— vulnerability reporting and security policyCHANGELOG.md— release history and migration-relevant changeswalkthroughs/— guided onboarding steps for connections, explorer, notebooks, and sync
Stable: v2.4.0 · Nightly: v2.5.0
See CHANGELOG.md for the current release notes and the website for product-level updates.
🏗️ Project structure
NexQL-Core/
├── src/
│ ├── extension.ts # Extension entry point
│ ├── commands/ # Database and notebook commands
│ │ ├── sql/ # Reusable SQL template modules
│ │ └── ...
│ ├── providers/ # Tree, notebook, completion, and chat seams
│ ├── services/ # Connections, secrets, query history, telemetry
│ ├── renderer/ # Notebook result rendering and interactions
│ ├── ui/ # Shared UI and renderer components
│ ├── pro/ # Core ↔ Pro integration seam and stubs
│ └── test/ # Unit, integration, and renderer tests
├── resources/ # Icons, styles, and bundled assets
├── docs/ # Technical documentation
├── walkthroughs/ # Guided in-product
