v3.5 Smart features — schema diff & migrations, an editable ERD, JSONB & charts

Postgres for humans.
SQL for the curious.

Filter, sort, edit, insert, import and export your tables by point-and-click — while pglens shows you the exact SQL behind every move. Free, open source, and nothing ever leaves your machine.

curl -fsSL https://pglens.org/install.sh | bash

One command installs everything · MIT licensed · bound to 127.0.0.1

Star on GitHub
The idea, in one gesture Move the lens — every click in pglens is honest SQL underneath.

Everything you'd open a SQL client for — without typing a query

See it whole — then shape it

Understand any database in seconds

An auto-drawn map of every table and how they connect — hover to spotlight relationships, filter live, and export the whole picture. New in 3.5: the map is editable — drag a handle to add a foreign key, add or retype columns, and pglens turns your edits into reviewable DDL behind the Run button.

pglens — schema map
Take the tour

A full database client.
None of the SQL.

01

Filter and sort like a spreadsheet

Build a filter from a column, an operator, and a value — no WHERE clause to remember. Stack multiple sorts by dragging them into the order you want, then save the whole setup as a named view you can jump back to anytime.

  • Type-aware operators: ranges, LIKE, IN, IS NULL, JSON & array
  • Drag-to-reorder multi-column sort
  • Saved views, shareable by link
shop / orders
02

Edit and add data, right in the grid

Double-click a cell to change it. pglens picks the right control for the column — a toggle for booleans, a date picker, a validated JSON editor — so you can't write a bad value. Adding a row is a guided form built from your schema.

  • Type-aware editing with instant rollback on error
  • Insert form that knows your defaults and required fields
  • Edits run as safe, pinned-to-primary-key updates
shop / orders — editing
03

Follow the data across tables

Click any foreign-key value to slide in the row it points to — no join to write, no second tab to open. Keep clicking to walk the relationships, with breadcrumbs back, or jump to every row that references it.

  • One-click foreign-key navigation with breadcrumbs
  • "Show all rows where this = that" in one tap
  • Edit the referenced row without leaving the panel
shop / orders
04

Prefer SQL? Flip any tab to Advanced Mode

Every no-code action has a Show SQL button, so you see exactly what runs. Want to take over? Flip any tab to Advanced Mode — a schema-aware Monaco editor seeded with the query no-code was about to run, with autocomplete, transactions, timing, and a per-connection history and saved-query library.

  • Schema autocomplete, :name params & format-on-save
  • Transaction mode with BEGIN / COMMIT / ROLLBACK
  • Multi-statement results, CSV/JSON export & EXPLAIN ANALYZE timing
  • Per-connection query history & saved queries with folders + tags
advanced mode
05

See what your database is doing, live

The new Operations panel is the tab you open when things are busy or slow: a live dashboard of active sessions, locks and blocking chains, replication lag and table sizes — plus a slow-query view over pg_stat_statements, ranked by total or mean time with an estimated p95. All read-only introspection of Postgres's own stat views.

  • Active sessions, blocking chains & connection usage at a glance
  • Slowest statements by total / mean time, with estimated p95
  • Cancel or terminate a runaway backend in one click
operations — activity
06

Find the slow node — and the missing index

Hand any query to the EXPLAIN visualizer: a tree of the plan with each node's cost, planned vs. actual rows, and real timing, heat-mapped so the expensive node lights up instead of its parents. The index assistant reads your catalogs for unused and duplicate indexes — every DROP INDEX shown for you to review, never run for you.

  • Exclusive (self) time per node, with planner misestimate flagged
  • Heatmap by time, rows or cost — plain-English node tooltips
  • Unused, duplicate & seq-scan-heavy tables, read-only
explain — analyze
07

Find any table instantly

Hit Cmd/Ctrl+K to open Spotlight and fuzzy-jump to any table or view in any schema — no scrolling through endless sidebars.

  • Fuzzy match across tables & views
  • Keyboard-first, opens in a new tab
  • Works across every schema, not just public
⌘K
08

All your databases, one home

Every server lives in a single clean grid. Connections come back when you reopen pglens, and your passwords stay in your OS keychain — never in a config file, never in the cloud.

  • Connect by parameters or a connection URL
  • SSL modes: Disable, Require, Prefer, Verify CA / Full
  • Secrets in your OS keychain, bound to 127.0.0.1
connections
09

Diff two databases, get the migration

Point pglens at two connections — staging and prod, say — and it introspects both and writes the forward and backward migration between them. Statements are ordered for dependency safety and destructive ones flagged red. Like every generator in pglens, nothing runs: the migration opens in the editor, behind the Run button.

  • Forward (source→target) and backward migration, both ways
  • Dependency-ordered DDL with destructive changes flagged
  • Reviewable SQL opened against the connection it targets
diff & migrate
10

Chart any result, no re-query

Flip any query result or table page to the Chart view and pglens plots the rows already in hand. It reads your columns — numeric, temporal, categorical — to suggest a line, bar or scatter with sensible axes, and you can override the type or either axis.

  • Line, bar & scatter from the rows you already loaded
  • Auto-suggested chart type and axes from column types
  • No second round trip — it plots what's on screen
chart — revenue by day
Why pglens

Built to do the work,
not just show the rows.

Other clients make you write SQL for everything, or lock the good parts behind a subscription. pglens does it all by point-and-click — for free.

01

Visual filter & sort

Point-and-click filters and drag-to-reorder multi-column sorting. Save any combination as a named view.

02

Inline editing & insert

Edit cells with type-aware controls and add rows through a schema-built form. No bad values, no UPDATE statements.

03

Follow foreign keys

Click a value to open the row it references, walk relationships with breadcrumbs, and edit along the way.

04

One-click aggregations

Count, sum, avg, min, max, stddev and distinct counts pinned to the bottom of every grid — computed on the active filter.

05

Export & import

Export tables to CSV, JSON or SQL respecting your filter and columns. Import CSV with column mapping and conflict handling.

06

Schema visualizer

Auto-laid-out relationship graph with hover spotlight, live filtering, minimap, and export to SVG or Mermaid ER.

07

Show SQL & Advanced Mode

Every no-code action reveals the exact query it runs — and any tab flips to a schema-aware Monaco editor with transactions, timing, history & saved queries.

08

Operations dashboard

Live activity over Postgres's stat views — sessions, locks, replication, sizes — plus a slow-query view on pg_stat_statements. Cancel a backend in a click.

09

EXPLAIN & index advisor

A heat-mapped EXPLAIN plan tree that lights up the costly node, and read-only advice on unused, duplicate & seq-scan-heavy indexes — every DROP shown to review.

10

Schema diff & migrations

Diff two connected databases and generate a forward and backward migration — dependency-ordered, destructive changes flagged, opened in the editor to review.

11

Visual ERD editor

Drag a handle to add a foreign key, add or retype columns, drop them. Edits become reviewable DDL built from structured ops — never SQL fragments from the browser.

12

JSONB explorer

Sample a jsonb column to infer its key set and types, then click a key to add a native ->>, @> or ? predicate to the filter bar.

13

Extensions panel

Browse available extensions with installed vs. default version, then install or drop with one click — RESTRICT, never CASCADE, DDL shown for review.

14

Charts

Plot any result or table page — line, bar or scatter — from the rows already loaded, with chart type and axes auto-suggested from your columns. No re-query.

15

Private by default

Runs on your machine, bound to 127.0.0.1, secrets in the OS keychain. No account, no telemetry, nothing in the cloud.

FAQ

Questions, answered.

Do I need to know SQL?

No. Filtering, sorting, editing, inserting, aggregating, exporting and importing are all point-and-click. SQL is optional — and when you're curious, "Show SQL" reveals exactly what each action runs.

Can I write my own SQL when I want to?

Yes — flip any tab to Advanced Mode for a schema-aware Monaco editor with autocomplete, :name parameters, format-on-save, transaction mode (BEGIN/COMMIT/ROLLBACK), multi-statement results with EXPLAIN ANALYZE timing, and a per-connection query history plus a saved-query library with folders and tags. It opens seeded with the query no-code was about to run, so you start from a working query, not a blank page.

How is pglens different from pgAdmin, DBeaver or TablePlus?

Most clients are SQL-first — you write queries to do anything real, or pay for the no-code parts. pglens flips that: filter, edit, insert, follow foreign keys, aggregate and import/export without typing SQL, with the generated query always visible. Free, open source, and runs locally.

Is editing my data safe?

Yes. No-code actions never send raw SQL from the browser — the server turns your choices into parameterized queries. Edits are pinned to the primary key, type-validated, applied optimistically, and rolled back if the database rejects them.

Can pglens help when the database is slow?

Yes. The Operations panel shows live activity (active sessions, locks and blocking chains, replication, sizes), a slow-query view over pg_stat_statements, an EXPLAIN plan visualizer that heat-maps the costly node, and an index assistant for unused and duplicate indexes. It's all read-only introspection of Postgres's own catalogs — the only SQL it generates is a DROP INDEX shown for you to review, never run for you.

Can pglens generate migrations or edit my schema?

Yes. Diff & migrate compares two connected databases and produces a forward and backward migration; the visual ERD editor lets you add foreign keys, add or retype columns and drop them. Both turn your changes into dependency-ordered DDL with destructive statements flagged — and, like the index assistant, pglens never runs it. The SQL opens in the editor, behind the Run button, built server-side from structured operations rather than SQL typed in the browser.

Is pglens free?

Yes. pglens is open source and MIT licensed. No account, no telemetry, no paywall.

Is my data sent anywhere?

No. pglens is local-first — it binds to 127.0.0.1 only, routes are token-gated, and passwords are stored in your OS keychain. Nothing leaves your machine.

Which platforms and Postgres versions are supported?

macOS, Linux and Windows, with any modern PostgreSQL server. One install command sets up Node.js and every dependency. Connect by parameters or URL, pick any schema, choose your SSL mode.

Get started

Stop writing SELECT *
just to look around.

curl -fsSL https://pglens.org/install.sh | bash

Free & open source · no account · no telemetry