Native macOS & iPadOS · SwiftUI + Rust

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.

Transactional DDL On-device AI CSV · JSONL · Parquet SSH tunneling Keychain-only secrets Validated on PostgreSQL 18

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_functiondef for the precise overload, edits in a real SQL editor, applies CREATE OR REPLACE.
  • Typed parameter runnerCall it with a generated, type-aware form — CALL vs SELECT * FROM, named args, NULL/DEFAULT — and save fixtures to replay.
  • Attributes as controls + security lensVolatility, parallelism, cost, SET search_path as real controls — and a lens that flags SECURITY DEFINER without a pinned path.
  • Inline plpgsql_checkCatches the bugs CREATE FUNCTION accepts — 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_path preserved across a forced DROP + 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.

Explore

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

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.

Edit

Inline cell editing

Click-to-edit grid cells with type-aware coercion and an unsaved-edits indicator.

Terminal

SSH, done right

SwiftTerm PTY with full xterm-256color, tabbed sessions, split panes and a ⌘K command palette.

Transfer

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.

Trust

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.

Intelligence

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.

01 · UI
SwiftUI + AppKit
Native Mac windowing & iPad app, NSTableView-grade grids, the SQL editor and every panel.
02 · Bridge
UniFFI
Proc-macro-generated, checksum-verified Swift bindings over the Rust surface — no hand-written glue.
03 · Core
Rust engine
ssh-commander-core — connection pooling, the PostgreSQL protocol, cursors, transactions, Parquet export.
04 · Targets
Postgres & SSH
Pooled Postgres over optional SSH tunnels; PTY, SFTP and known-hosts trust on the same connection.

Why it reads as a reference project

Engineered, not assembled.

0 surprises

Every DDL change runs through a transactional dry-run with a dependency blast-radius before it can commit.

Live-validated

Catalog queries and generated SQL verified against a real PostgreSQL 18 — overloads, aggregates, procedures, ACLs.

Native speed

AppKit-backed grids and editors — no Electron, no JVM. It launches and responds like a Mac app should.

Memory-safe

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.