{"id":39561499,"url":"https://github.com/riii111/sabiql","last_synced_at":"2026-04-25T15:05:31.303Z","repository":{"id":331581569,"uuid":"1123541397","full_name":"riii111/sabiql","owner":"riii111","description":"A fast PostgreSQL TUI written in Rust — driver-less, vim-first, with ER diagrams. No database drivers, no setup, just psql","archived":false,"fork":false,"pushed_at":"2026-04-24T20:46:03.000Z","size":4358,"stargazers_count":165,"open_issues_count":1,"forks_count":6,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-24T21:31:08.947Z","etag":null,"topics":["postgresql","ratatui","rust","tui"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/riii111.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-27T05:01:13.000Z","updated_at":"2026-04-24T20:46:07.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/riii111/sabiql","commit_stats":null,"previous_names":["riii111/sabiql"],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/riii111/sabiql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riii111%2Fsabiql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riii111%2Fsabiql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riii111%2Fsabiql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riii111%2Fsabiql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/riii111","download_url":"https://codeload.github.com/riii111/sabiql/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riii111%2Fsabiql/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32266012,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T09:15:33.318Z","status":"ssl_error","status_checked_at":"2026-04-25T09:15:31.997Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["postgresql","ratatui","rust","tui"],"created_at":"2026-01-18T07:08:24.360Z","updated_at":"2026-04-25T15:05:31.294Z","avatar_url":"https://github.com/riii111.png","language":"Rust","funding_links":[],"categories":["Applications","💻 Apps","CLI"],"sub_categories":["Database","⌨️ Development Tools"],"readme":"# sabiql\n![hero](https://github.com/user-attachments/assets/745ab18f-915c-4017-81a6-465c5c5ee11c)\n\nA fast, driver-less TUI to browse, query, and edit PostgreSQL databases — no drivers, no setup, just `psql`.\n\n[![CI](https://github.com/riii111/sabiql/actions/workflows/ci.yml/badge.svg)](https://github.com/riii111/sabiql/actions/workflows/ci.yml)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n## Concept\n\n\u003e Vim-first · Safe by design · Oil-and-vinegar UI · Fast and lightweight\n\nsabiql wraps your existing `psql` CLI. No Rust database drivers, no connection pools, no extra dependencies. Point it at your database and get a full-featured TUI. Your `psql` config, `.pgpass`, SSL setup all just work.\n\nInspired by [oil.nvim](https://github.com/stevearc/oil.nvim)'s \"oil and vinegar\" philosophy: UI elements appear only when needed, never occupying your screen permanently. Vim-native keybindings (`j/k`, `dd`, `/`) let you navigate and edit without leaving your muscle memory.\n\nDestructive operations are guarded. Inline edits and row deletions always show a preview modal before touching your data. Read-only mode (`Ctrl+R`) goes further — block all writes at the PostgreSQL session level with a single keystroke.\n\nBuilt in Rust for minimal memory footprint and near-zero idle CPU. A full-featured alternative to GUI tools like DBeaver or DataGrip, without ever leaving the terminal.\n\n## Features\n![hero-800](https://github.com/user-attachments/assets/b6b853a0-d7b4-486d-955c-aee74e7a2671)\n\n\n### Core\n\n- **Read-Only Mode** (`Ctrl+R`) — Toggle safe-browse mode; writes are blocked at both app and DB session level\n- **SQL Modal** (`s`) — Ad-hoc queries with auto-completion for tables, columns, and keywords; browse past results with `Ctrl+H`; recall previous queries with `Ctrl+O`\n- **ER Diagram** (`e`) — Generate relationship diagrams via Graphviz, opened instantly in your browser\n- **Inspector Pane** (`2`) — Column details, types, constraints, and indexes for any table\n\n### Editing\n\n- **Inline Cell Editing** (`e` in Result) — Edit cells in-place with a guarded UPDATE preview before committing\n- **Row Deletion** (`dd` in Result) — DELETE with mandatory preview; risk level color-coded (yellow/orange/red)\n- **Yank** (`y`) — Copy any cell value to clipboard\n- **CSV Export** (`Ctrl+E`) — Export query results to a CSV file\n\n### Query Analysis\n\n- **EXPLAIN / EXPLAIN ANALYZE** — Run your query, then switch tabs to instantly view its execution plan. Compare two plans side-by-side to pinpoint performance bottlenecks — no copy-paste, no external tools, all within the same modal.\n\n### Navigation\n\n- **Fuzzy Search** (`/`) — Incremental table filtering\n- **Focus Mode** (`f`) — Expand any pane to full screen\n- **Command Palette** (`Ctrl+K`) — Searchable command list\n\n## Installation\n\n```bash\n# macOS / Linux\nbrew install riii111/sabiql/sabiql\n\n# Cargo (crates.io)\ncargo install sabiql\n\n# Arch Linux (AUR)\nparu -S sabiql  # or yay -S sabiql\n\n# Void Linux (Unofficial Repo)\necho repository=https://raw.githubusercontent.com/Event-Horizon-VL/blackhole-vl/repository-x86_64 | sudo tee /etc/xbps.d/20-repository-extra.conf\nsudo xbps-install -S sabiql\n\n# FreeBSD (ports)\ncd /usr/ports/databases/sabiql/ \u0026\u0026 make install clean\n\n# Install script\ncurl -fsSL https://raw.githubusercontent.com/riii111/sabiql/main/install.sh | sh\n```\n\n## Quick Start\n\n```bash\nsabiql\n```\n\nOn first run, enter your connection details — saved to `~/.config/sabiql/connections.toml`. Press `?` for help.\n\n## Requirements\n\n- `psql` CLI (PostgreSQL client)\n- Graphviz (optional, for ER diagrams): `brew install graphviz`\n\n## Development\n\nWith Nix:\n\n```bash\ndirenv allow\ncargo nextest run --workspace\nnix build\n```\n\nWithout direnv, enter the shell explicitly:\n\n```bash\nnix develop\n```\n\n## Environment Variables\n\n| Variable | Description |\n|----------|-------------|\n| `SABIQL_BROWSER` | Browser for ER diagrams (e.g., `Arc`, `Firefox`). macOS uses `open -a`; falls back to OS default. |\n\n## Roadmap\n\n- [x] Connection management UI\n- [x] ER diagram generation\n- [x] Read-only mode (`Ctrl+R`)\n- [x] SQL modal with DML/DDL safety guardrails\n- [x] Query history persistence \u0026 fuzzy search\n- [x] CSV export \u0026 clipboard yank\n- [x] EXPLAIN workflow (plan tree view \u0026 comparison)\n- [x] JSON/JSONB support (tree view, editing, validation)\n- [ ] Neovim integration (`sabiql.nvim`)\n- [ ] SQLite support\n- [ ] Zero-config connection (env vars, `.pgpass`, URI auto-detect)\n- [ ] Google Cloud SQL / AlloyDB support\n- [ ] Theme switching (foreground palette only)\n- [ ] MySQL support\n\nHave a feature request? [Open an issue](https://github.com/riii111/sabiql/issues/new) feedback is welcome!\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friii111%2Fsabiql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Friii111%2Fsabiql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friii111%2Fsabiql/lists"}