The database client that
refuses to break things.
pgAgent is a native Mac & iPad workspace for PostgreSQL and SSH — with a routine editor that out-engineers the big IDEs, and a DDL pipeline that won't let an edit silently take down your schema.
Built with SwiftUI · AppKit · Rust over UniFFI — one codebase, Mac & iPad.
The routine editor
Edit a function like you mean it.
Most clients show you a function's source read-only and wish you luck. pgAgent makes routines a first-class, editable, testable object — and treats every change as a transaction you get to inspect before it lands.
- ↺Edit & replace, exact overloadLoads the live
pg_get_functiondeffor the precise overload, edits in a real SQL editor, appliesCREATE OR REPLACE. - ▶Typed parameter runnerCall it with a generated, type-aware form —
CALLvsSELECT * FROM, named args, NULL/DEFAULT — and save fixtures to replay. - ⚙Attributes as controls + security lensVolatility, parallelism, cost,
SET search_pathas real controls — and a lens that flagsSECURITY DEFINERwithout a pinned path. - ✓Inline plpgsql_checkCatches the bugs
CREATE FUNCTIONaccepts — bad column refs, type mismatches — and jumps to the offending line. Works on managed Postgres. - ⛉Safe-ApplyA transactional dry-run, the exact dependency blast-radius, and ACL/
search_pathpreserved across a forcedDROP + CREATE— then one explicit commit.
The whole workspace
Depth where the work happens.
A multi-database explorer, a real query surface, a terminal, and file transfer — all native, all fast.
Schema tree & ERD
Multi-database tree down to tables, views, mat-views, sequences and functions — with a generated entity-relationship diagram and full DDL for every node.
Query tabs that scale
Per-tab server-side cursors, multi-statement scripts, paginated results, history and saved queries — export unbounded results to CSV, JSONL or Parquet.
Inline cell editing
Click-to-edit grid cells with type-aware coercion and an unsaved-edits indicator.
SSH, done right
SwiftTerm PTY with full xterm-256color, tabbed sessions, split panes and a ⌘K command palette.
Dual-pane SFTP
Side-by-side local/remote, drag-and-drop, and a three-way diff with snapshot-before-write so a typo never takes a host down.
Secrets stay in the Keychain
Passwords and key passphrases live only in the macOS/iOS Keychain. SSH key vault with per-key access coordination, and TOFU host-key verification that fails closed.
On-device AI
Generate SQL from a description and explain errors in plain language — running on Apple's on-device model, grounded in your real schema. Nothing leaves the machine.
Under the hood
One Rust core. Two native apps.
The protocol and database work live in a Rust core exposed to Swift through UniFFI — so the Mac and iPad apps share one tested, memory-safe engine and stay thin, native shells.
ssh-commander-core — connection pooling, the PostgreSQL protocol, cursors, transactions, Parquet export.Why it reads as a reference project
Engineered, not assembled.
Every DDL change runs through a transactional dry-run with a dependency blast-radius before it can commit.
Catalog queries and generated SQL verified against a real PostgreSQL 18 — overloads, aggregates, procedures, ACLs.
AppKit-backed grids and editors — no Electron, no JVM. It launches and responds like a Mac app should.
The protocol and data layer are Rust; Swift never hand-parses a wire protocol or manages a socket.
Read the source.
The full architecture, the routine-editor design notes, and the engineering decisions are all in the open.