GitHub

hero

A fast, driver-less TUI for browsing, querying, and editing PostgreSQL and SQLite databases from the terminal. It works with the database CLI you already use: psql or sqlite3.

CI License: MIT

Concept

Vim-first · Safe by design · Oil-and-vinegar UI · Fast and lightweight

sabiql brings database browsing, querying, and editing into the terminal without replacing your existing database setup. PostgreSQL connections continue to use your psql configuration, .pgpass, and SSL settings.

Like oil.nvim, sabiql keeps its interface out of your way. Following oil.nvim's "oil and vinegar" philosophy, UI elements appear only when needed. Vim-native keybindings such as j/k, dd, and / keep navigation and editing familiar.

Safety follows a plan-before-apply flow familiar from Terraform: inline edits and row deletions show the SQL and its risk level before you confirm the change. Read-only mode (Ctrl+R) also blocks writes at the database client level.

Features

hero_1000_20fps

  • Browse and inspect — Find tables with fuzzy search and inspect columns, types, constraints, and indexes
  • Run SQL — Write ad-hoc queries with completion for tables, columns, and keywords, then recall them from query history
  • Edit with previews — Update cells or delete rows only after reviewing the SQL and its risk level
  • Browse in read-only mode (Ctrl+R) — Block writes while investigating data
  • Analyze queries — View and compare PostgreSQL execution plans or inspect SQLite query plans
  • Work with data — Copy cell values, export CSV, and inspect or edit PostgreSQL JSON/JSONB documents
  • Visualize relationships — Generate PostgreSQL ER diagrams with Graphviz and open them in your browser

Press ? inside sabiql to see all commands and keybindings.

Installation

# macOS / Linux
brew install riii111/sabiql/sabiql
# Cargo (crates.io)
cargo install sabiql
# Nix
nix profile install github:riii111/sabiql
# Run once with Nix, without installing
nix run github:riii111/sabiql
# Windows x86_64 (experimental)
# Download sabiql-x86_64-pc-windows-msvc.zip from GitHub Releases,
# extract sabiql.exe, and add its directory to PATH.
# Arch Linux (AUR)
paru -S sabiql  # or yay -S sabiql
# Void Linux (Unofficial Repo)
echo "repository=https://mirror.black-hole.dev/$(xbps-uhelper arch)/" | sudo tee /etc/xbps.d/20-repository-extra.conf
sudo xbps-install -S sabiql
# FreeBSD (ports)
cd /usr/ports/databases/sabiql/ && make install clean
# Install script
curl -fsSL https://raw.githubusercontent.com/riii111/sabiql/main/install.sh | sh

Database Setup

sabiql uses the CLI for the database you want to open:

  • To use PostgreSQL: install psql
  • To use SQLite: install sqlite3 version 3.41.1 or later

Graphviz is optional and enables ER diagrams for PostgreSQL. Windows support is experimental.

SQLite works with existing, regular database files. See SQLite support and limitations for details.

Quick Start

Launch sabiql and enter your connection details:

sabiql

You can also open an existing SQLite database directly:

sabiql /path/to/app.db

Use Ctrl+R before browsing data when you want to block writes. Press ? for help, or open Settings with , to change the theme and keymap.

Roadmap

  • Connection management UI
  • ER diagram generation
  • Read-only mode (Ctrl+R)
  • SQL modal with DML/DDL safety guardrails
  • Query history persistence & fuzzy search
  • CSV export & clipboard yank
  • EXPLAIN workflow (plan tree view & comparison)
  • JSON/JSONB support (tree view, editing, validation)
  • Theme switching (Sabiql Dark / Light)
  • SQLite support
  • Neovim integration (sabiql.nvim)
  • Zero-config connection (env vars, .pgpass, URI auto-detect)
  • Google Cloud SQL / AlloyDB support
  • MySQL support

Have a feature request? Open an issue. Feedback is welcome!

License

MIT — see LICENSE.

Read the original on github.com ↗