Minimal Postgres editor for speed and collaboration
Find a file
Tianzhou 2b49a9bf36 fix: bootstrap npm 11.5+ for OIDC trusted publishing
Bundled npm in Node 22.22.2 is both broken (missing promise-retry)
and too old (npm 10.x) for OIDC publishing which requires npm 11.5+.
Bootstrap by downloading the tarball directly, matching the approach
used in dbhub's workflow.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 10:28:40 -07:00
.claude chore: pg 19 pg stat statements 2026-02-17 23:41:51 -08:00
.github/workflows fix: bootstrap npm 11.5+ for OIDC trusted publishing 2026-04-08 10:28:40 -07:00
.vite/deps feat: open source pgconsole 2026-02-16 08:03:18 -08:00
docs feat: add custom logo branding for enterprise plan 2026-03-24 22:55:57 -07:00
proto feat: open source pgconsole 2026-02-16 08:03:18 -08:00
public feat: open source pgconsole 2026-02-16 08:03:18 -08:00
scripts feat: open source pgconsole 2026-02-16 08:03:18 -08:00
server fix: surface SQL parse errors instead of misleading permission denied 2026-03-25 20:05:23 -07:00
src fix: row detail panel now tracks selection by identity, not index 2026-04-08 10:05:20 -07:00
tests fix: surface SQL parse errors instead of misleading permission denied 2026-03-25 20:05:23 -07:00
website feat: add docs link to website header navbar 2026-03-22 08:44:36 -07:00
worker chore: rename worker to pgconsole with Demo class for pgconsole-demo container 2026-03-22 10:57:19 -07:00
.dockerignore feat: open source pgconsole 2026-02-16 08:03:18 -08:00
.gitignore feat: open source pgconsole 2026-02-16 08:03:18 -08:00
.npmrc feat: open source pgconsole 2026-02-16 08:03:18 -08:00
components.json feat: open source pgconsole 2026-02-16 08:03:18 -08:00
docker-compose.yml feat: open source pgconsole 2026-02-16 08:03:18 -08:00
docker-entrypoint.sh feat: open source pgconsole 2026-02-16 08:03:18 -08:00
Dockerfile feat: open source pgconsole 2026-02-16 08:03:18 -08:00
eslint.config.js feat: open source pgconsole 2026-02-16 08:03:18 -08:00
index.html feat: open source pgconsole 2026-02-16 08:03:18 -08:00
LICENSE feat: open source pgconsole 2026-02-16 08:03:18 -08:00
package.json chore: upgrade from 1.2.0 to 1.2.1 2026-04-08 10:06:18 -07:00
pgconsole.example.toml feat: add custom logo branding for enterprise plan 2026-03-24 22:55:57 -07:00
pnpm-lock.yaml feat: open source pgconsole 2026-02-16 08:03:18 -08:00
README.md Change Star History chart links to new format 2026-04-02 23:41:03 -07:00
tsconfig.app.json feat: open source pgconsole 2026-02-16 08:03:18 -08:00
tsconfig.json feat: open source pgconsole 2026-02-16 08:03:18 -08:00
tsconfig.node.json feat: open source pgconsole 2026-02-16 08:03:18 -08:00
vite.config.ts feat: open source pgconsole 2026-02-16 08:03:18 -08:00
vitest.config.ts feat: open source pgconsole 2026-02-16 08:03:18 -08:00

Note

pgplex: Modern Developer Stack for Postgres - pgconsole · pgtui · pgschema · pgparser

pgconsole

pgconsole SQL editor

pgconsole is a web-based PostgreSQL editor. Single binary, single config file, no database required. Connect your team to PostgreSQL with access control and audit logging built in.

Star History Chart

Installation

Visit https://docs.pgconsole.com/getting-started/quickstart

Prerequisites

  • Node.js 20+

npm

npm install -g @pgplex/pgconsole
pgconsole --config pgconsole.toml

npx

npx @pgplex/pgconsole --config pgconsole.toml

Docker

docker run -p 9876:9876 -v /path/to/pgconsole.toml:/etc/pgconsole.toml pgplex/pgconsole

Run without --config to start in demo mode with a bundled sample database.

Features

SQL Editor

A full-featured SQL workspace with real-time intelligence powered by a PostgreSQL parser — not regex.

  • Autocomplete — context-aware suggestions for tables, columns, joins, and CTEs
  • Formatting — pretty-print or collapse SQL to one line
  • Error detection — red underlines with hover tooltips
  • Code folding — collapse SELECT, WITH, and other blocks
  • Function signature help — parameter hints as you type
Autocomplete

Data Grid & Inline Editing

Query results appear in a virtual-scrolling grid. With write permission, you can edit data directly — all changes are staged locally and previewed before execution.

  • Double-click a cell to edit, or use the row detail panel
  • Add, delete, and duplicate rows
  • Staged changes are color-coded: green (INSERT), amber (UPDATE), red (DELETE)
  • Preview generated SQL and optionally run an AI risk assessment before executing
Staged changes preview

Schema Browser

Browse and inspect database objects — tables, views, materialized views, functions, and procedures — with full metadata, indexes, constraints, triggers, and grants.

Schema browser

AI Assistant

Generate, explain, fix, and rewrite SQL with an AI assistant that understands your schema context. Supports OpenAI, Anthropic, and Google providers.

  • Text-to-SQL — describe a query in natural language, get SQL back
  • Explain SQL — get plain-language explanations of any query
  • Fix SQL — AI-powered error correction from inline linting
  • Rewrite SQL — optimize queries for performance or readability
  • Risk assessment — analyze staged changes for potential risks before execution
AI Text-to-SQL
AI risk assessment

Database Access Control

Fine-grained IAM controls who can read, write, or administer each connection. Permissions are enforced at the application layer — no database roles needed.

  • Default deny — users have no access unless a rule explicitly grants it
  • Connection-scoped — permissions are granted per connection, not globally
  • Disjoint permissionsread, write, ddl, admin, explain, execute, export are independent
Permission denied
Permission badge

Audit Log

Every query and login is recorded as structured JSON to stdout. Filter and forward to your log infrastructure.

{
  "type": "audit",
  "ts": "2024-01-15T10:32:15.456Z",
  "action": "sql.execute",
  "actor": "alice@example.com",
  "connection": "prod-db",
  "sql": "SELECT * FROM users WHERE active = true",
  "duration_ms": 45,
  "row_count": 150
}

Single-File Configuration

Everything lives in pgconsole.toml — connections, users, groups, access rules, AI providers. No database required.

[[connections]]
id = "production"
name = "Production"
host = "db.example.com"
port = 5432
database = "myapp"
username = "readonly"
password = "..."

[[iam]]
connection = "production"
permissions = ["read", "explain", "export"]
members = ["*"]

[[iam]]
connection = "production"
permissions = ["*"]
members = ["group:dba"]

[[ai.providers]]
id = "claude"
vendor = "anthropic"
model = "claude-sonnet-4-20250514"
api_key = "sk-ant-..."

Getting Help

Development

Note

For external contributors: If you want to request a feature, please create a GitHub issue to discuss first instead of creating a PR directly.

git clone https://github.com/pgplex/pgconsole.git
cd pgconsole
pnpm install
pnpm dev        # Start dev server (frontend + backend)
pnpm build      # Production build
pnpm test       # Run all tests