Open-Source, AI-Powered PostgreSQL Client
A modern database tool that combines query analysis, visual schema exploration, and AI-assisted optimization in a fast, native desktop application.
Traditional database tools force you to switch between multiple applications: one for writing queries, another for visualizing schemas, a third for analyzing execution plans, and perhaps a web service for optimization advice.
Freud unifies these workflows into a single, keyboard-driven interface with AI assistance built in—not bolted on.
- Write SQL with LSP-powered autocomplete that understands your schema
- Analyze performance with interactive execution plan visualization
- Optimize queries with AI that explains problems and suggests fixes
- Explore schemas with ER diagrams generated from your live database
- Edit data directly in query results without writing UPDATE statements
Built with Rust and Tauri for native performance. No Electron. No web browser overhead.
Freud integrates large language models directly into your workflow:
- Structured Analysis — AI examines execution plans and identifies bottlenecks, missing indexes, and suboptimal joins
- Actionable Recommendations — Each suggestion includes impact assessment, implementation effort, and production risk level
- Interactive Chat — Ask follow-up questions about your queries and get contextual advice with executable SQL snippets
- Natural Language to SQL — Describe what you want in plain English; Freud generates the query using your schema
Supports GPT-4o, GPT-4 Turbo, o1, and other OpenAI models.
- PostgreSQL LSP — Context-aware completions for tables, columns, functions, and keywords powered by
postgres_lsp - Real-time Validation — Syntax errors highlighted as you type with line and column information
- SQL Formatting — Auto-format on paste or with
Shift+Alt+F - Multi-tab Workspace — Work on multiple queries simultaneously with persistent session state
- Interactive Graph — Execution plans rendered as navigable node trees
- Estimate Accuracy — Nodes color-coded by how closely estimated rows match actual rows
- Detailed Metrics — Hover for costs, timings, buffer usage, loops, and filter statistics
- Multiple Views — Switch between visual, text, and raw JSON representations
- Live Schema Visualization — Generate entity-relationship diagrams from your connected database
- Relationship Mapping — Foreign keys displayed as labeled edges with ON UPDATE/DELETE actions
- Interactive Layout — Hierarchical auto-arrangement with drag-to-reposition
- Export — Save diagrams as PNG or SVG for documentation
- Virtualized Rendering — Handle large result sets efficiently
- Direct Data Editing — Double-click cells to modify values; changes are committed to the database
- Inline Filtering — Add WHERE and ORDER BY clauses without rewriting queries
- Export — Download results as CSV
- Schema Browser — Hierarchical tree of schemas, tables, views, functions, sequences, and indexes
- Column Inspector — Data types, nullability, defaults, primary and foreign key indicators
- Index Details — Type, definition, uniqueness, and size information
- Context Actions — Right-click to view ER diagrams, set default schema, or generate queries
- Saved Connections — Store and organize multiple database connections
- URI Support — Connect using
postgres://connection strings - Auto-Reconnect — Automatically connect to your last used database on startup
- Connection Testing — Verify credentials before connecting
| Shortcut | Action |
|---|---|
Cmd/Ctrl + Enter |
Execute Query |
Cmd/Ctrl + Shift + Enter |
Run EXPLAIN |
Cmd/Ctrl + T |
New Tab |
Cmd/Ctrl + W |
Close Tab |
Cmd/Ctrl + 1-9 |
Switch to Tab |
Shift + Alt + F |
Format SQL |
Escape |
Cancel Query / Close Panel |
git clone https://github.com/yourusername/freud.git
cd freud
npm install
npm run tauri devnpm run tauri buildBinaries are output to src-tauri/target/release/.
- Connect — Enter connection details or select a saved connection
- Explore — Browse schemas, tables, and relationships in the navigator
- Query — Write SQL with autocomplete and real-time validation
- Analyze — Run EXPLAIN ANALYZE to visualize execution plans
- Optimize — Get AI recommendations and iterate on performance
- Document — Export ER diagrams and query results
- Open Settings from the toolbar
- Enter your OpenAI API key
- Select a model (GPT-4o recommended for best results)
API keys are stored locally and transmitted only to OpenAI.
| Component | Technology |
|---|---|
| Runtime | Tauri 2.0 + Rust |
| Frontend | React 19, TypeScript, Vite |
| Database Driver | tokio-postgres |
| Editor | CodeMirror 6 |
| Language Server | postgres_lsp |
| Visualization | vis-network |
| AI | OpenAI API |
freud/
├── src/ # React frontend
│ ├── components/ # UI components
│ ├── hooks/ # Custom React hooks
│ ├── contexts/ # State management
│ └── styles/ # CSS modules
├── src-tauri/ # Rust backend
│ ├── src/
│ │ ├── commands/ # Tauri IPC handlers
│ │ ├── lsp/ # LSP integration
│ │ └── lib.rs # Application core
│ └── Cargo.toml
└── package.json
Contributions are welcome. Please open an issue to discuss proposed changes before submitting a pull request.
MIT