A modern, cross-platform PostgreSQL database client built with Electron, React, and TypeScript.
BetterDB is a lightweight desktop application for managing PostgreSQL databases. It provides an intuitive interface for browsing schemas, writing queries, and editing data — without the bloat of traditional database GUIs.
- Connection Manager — Save and organize multiple PostgreSQL connections with SSL support. Compatible with Supabase and AWS RDS.
- Schema Explorer — Browse databases, schemas, tables, and views in a collapsible tree sidebar.
- SQL Editor — Write and execute queries with a CodeMirror-powered editor featuring SQL syntax highlighting and a dark theme.
- Query Results — View results in a fast, virtualized table with column type awareness and execution time metrics.
- Inline Data Editing — Edit cell values, insert rows, and delete records directly from the table view.
- Paginated Table Viewer — Navigate large tables with server-side pagination and sortable columns.
- Foreign Key Introspection — View column-level foreign key references across your schema.
electron/
├── db/
│ ├── DatabaseAdapter.ts # Abstract adapter (extensible to other engines)
│ ├── PostgresAdapter.ts # PostgreSQL implementation via node-postgres
│ └── ConnectionManager.ts # Singleton connection factory
├── ipc/
│ └── handlers.ts # IPC bridge between main & renderer
└── storage/
└── connections.ts # Encrypted connection persistence
src/
├── components/
│ ├── connections/ # Connection form & panel
│ ├── query/ # SQL editor & results
│ ├── schema/ # Schema tree browser
│ └── table/ # Virtualized table viewer
├── stores/ # Zustand state management
└── lib/
└── ipc.ts # Typed IPC wrapper for renderer
shared/
└── types.ts # Shared types across processes
| Layer | Technology |
|---|---|
| Framework | Electron 30 |
| Frontend | React 18, TypeScript |
| Bundler | Vite 5 with vite-plugin-electron |
| Styling | Tailwind CSS, shadcn/ui |
| State | Zustand |
| Editor | CodeMirror 6 |
| Tables | @tanstack/react-virtual |
| Database | node-postgres (pg) |
- Node.js >= 18
- npm >= 9
npm install
npm run devThis launches the Electron app in development mode with hot module replacement.
npm run buildGenerates a distributable package in the release/ directory for your platform.
npm run lint- MySQL / SQLite adapter support
- Query history and saved queries
- Export results to CSV / JSON
- Table structure editor (DDL)
- Multiple query tabs
