#81

feat: Postgres dump & restore (developer-convenience slice, W2)

OpenMRL-00wants to merge intofrom

Adds the first vertical slice of developer-convenience dump/restore for Postgres: dump a table or schema to a plain-SQL file and restore a dump file into a database, all by shelling out to pg_dump/psql with explicit argument vectors (no shell) and streaming bytes to/from disk so large transfers never hit memory. The backend adds typed dump_postgres/restore_postgres/cancel_dump IPC commands behind a narrow dialog capability, passes the password via PGPASSWORD (never to disk or argv), runs restores in a single transaction with ON_ERROR_STOP, and surfaces missing-binary, auth, version-mismatch, and SQL errors clearly — covered by 10 Rust tests on argument/path/option construction. The frontend adds dump and restore modals (live progress, cancel, prod-connection warnings, destructive confirm) with sidebar entry points on table/schema/database/connection nodes, and stops the Settings "Backups" panel from presenting unwired features as functional. It also makes codegen strip a tauri-specta rc.21 TAURI_CHANNEL import/alias collision and fixes a pre-existing red IPC command-surface test (missing findUsages).

🤖 Generated with Claude Code


NOTE

High Risk Restore runs arbitrary SQL against a live database with stored credentials; mistakes or malicious dump files can destroy or corrupt data despite transactional restore and UI confirmations.

Overview Postgres dump & restore (developer slice) — Users can export a table or schema to plain .sql and restore a dump into a chosen database. The Rust backend adds dump_postgres, restore_postgres, and cancel_dump, spawning pg_dump/psql with argv (no shell), streaming I/O, byte progress over a Tauri Channel, and passwords via PGPASSWORD only. Restores use psql with --single-transaction and ON_ERROR_STOP=1; failed dumps delete partial files.

Desktop wiring — Registers DumpRegistry, tauri-plugin-dialog, and narrow dialog:allow-open / dialog:allow-save capabilities. ConnectionRegistry::connection_config resolves host/user for external tools. IPC types and mocks are updated; codegen strips a broken TAURI_CHANNEL alias from tauri-specta output.

UI — New dump/restore modals (file pickers, progress, stop, prod-connection banner, restore confirmation). Sidebar context menus on Postgres connections, databases, schemas, and tables expose dump/restore entry points. Settings Backups documents dump/restore and marks unwired backup/export controls as planned.

Reviewed by Cursor Bugbot for commit d43e6c562decec13824854581bbfeed9c34c5337. Bugbot is set up for automated code reviews on this repo. Configure here.

Activity

4
cursor[bot]4mo ago

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_8c54ef36-6c4b-4d39-b920-791f1475e1bf)

MRL-001mo ago

/open-code-review

github-actions[bot]1mo ago

🔍 OpenCodeReview found 7 issue(s) in this PR.

  • ✅ Successfully posted inline: 7 comment(s)