Skip to content

Building a modern Postgres explorer which is better than DBeaver or pgadmin4

License

Notifications You must be signed in to change notification settings

LauriSarap/bestgres

Repository files navigation

Bestgres

A fast, minimal PostgreSQL client built with Tauri v2, React, and Rust.

Features

Connections — Add, edit, remove connections with keychain password storage. Auto-saved to ~/.config/bestgres/. Health indicator per connection. Multi-database support with pool reuse.

Schema browser — Sidebar tree (Connection > Database > Tables/Views). Table structure view with columns, indexes, constraints, and foreign keys.

Table browser — Paginated data view with virtualized scrolling. Inline cell editing, row insert/delete, column sorting and filtering. Right-click to copy cell or row as JSON.

Query editor — SQL editor with syntax highlighting, Ctrl+Enter to run. Query history and saved/favorite queries persisted to disk.

Tabs — Multi-tab interface with deduplication. Right-click context menu (Close, Close Others, Close All). Keyboard shortcuts: Ctrl+T (new query), Ctrl+W (close tab), Ctrl+Tab (switch).

General — Light/dark theme with OS detection. Toast notifications for all actions. Cross-platform builds for Linux, Windows, and macOS.

Screenshots

Example 3 Example 1

Download

Grab the latest release for your platform from Releases.

Platform File
Linux (Debian/Ubuntu) .deb
Linux (Fedora/RHEL) .rpm
Linux (portable) .AppImage
Windows -setup.exe (NSIS installer)
macOS (Apple Silicon) .dmg (aarch64)
macOS (Intel) .dmg (x64)

Stack

Layer Tech
Framework Tauri v2
Backend Rust, sqlx, tokio
Frontend React 19, TypeScript, Vite, Tailwind CSS v4
Data grid TanStack Table + react-virtual
Icons Lucide React

Development

npm install
npm run tauri dev       # dev mode
npm run tauri build     # local production build

Sample databases

Two Postgres instances with sample data for testing (requires Docker):

npm run db:start        # start postgres1 (5432) and postgres2 (5433)
npm run db:stop         # stop both
npm run db:reset        # wipe data and recreate from scratch

Add connections in Bestgres:

Connection Host Port User Password Database
Instance 1 localhost 5432 postgres postgres app_db
Instance 2 localhost 5433 postgres postgres analytics
  • app_db: users, posts, comments, tags (blog-style schema)
  • analytics: events, metric_values, dashboards (JSONB, timestamps)

Project Structure

src-tauri/src/
├── commands/
│   ├── connection.rs   # Connection CRUD, pools, keychain
│   ├── query.rs        # Schema, columns, query execution, cell updates
│   └── history.rs      # Query history + saved queries (filesystem)
├── db/
│   └── postgres.rs     # sqlx wrappers, introspection, SQL builders
├── models.rs           # Shared data structures
├── lib.rs              # Tauri setup, command registration
└── main.rs

src/
├── components/
│   ├── Sidebar.tsx           # Connection + schema tree
│   ├── TabManager.tsx        # Tab bar + tab content routing
│   ├── TableBrowser.tsx      # Paginated table viewer + editing
│   ├── TableStructureView.tsx# DDL/structure inspector
│   ├── QueryEditor.tsx       # SQL editor + results + history panel
│   ├── SqlEditor.tsx         # Syntax-highlighted textarea
│   ├── DataGrid.tsx          # Virtualized data grid (TanStack)
│   ├── EditableCell.tsx      # Inline cell editor
│   ├── ConnectionDialog.tsx  # Add/edit connection form
│   └── Toast.tsx             # Toast notification system
├── hooks/
│   ├── use-invoke.ts         # Tauri invoke wrapper
│   └── use-theme.ts          # Light/dark toggle
├── types.ts
├── globals.css
└── App.tsx

About

Building a modern Postgres explorer which is better than DBeaver or pgadmin4

Resources

License

Stars

Watchers

Forks

Packages