sqex is an app for quick explorations of SQLite databases from the terminal. It lets you browse the schema and data of a database, run queries with a vim-mode SQL editor, and export results as CSV or JSON.
It is an inspection tool, not an admin tool: it never creates database files, never writes to your database implicitly, and asks before running anything destructive.
-
Install Rust (1.88 or later) if you don't have it:
brew install rust cargo --version
-
Install sqex:
cargo install --git https://github.com/rsmenon/sqlite-explorer.git
SQLite is bundled — there is no system dependency. Saved queries, query history, recent databases, and settings are stored locally in
~/.sqex/sqex.db. -
Open a database:
sqex path/to/db.sqlite
Or launch bare and open a file (or a recent database) from the Settings tab.
Shell completions and a man page are generated on demand:
sqex --completions <bash|zsh|fish>andsqex --man-pageeach print to stdout.
The interface has three tabs, switched with E, Q, and I from anywhere:
- Explore — a sidebar of tables, views, triggers, and pragmas; the detail panel shows columns, a filterable and sortable data preview, indexes, DDL, and storage stats. Foreign keys are jumpable: land on a referencing column or cell and follow it to the referenced table.
- Query — a SQL editor with vim keybindings, syntax highlighting, and autocomplete for table and column names. Results are paginated, and grids support a cell cursor, filtering, sorting, row/cell/full-result copy, and a full-value view for long text, JSON, and blobs. Query history is kept per database, survives restarts, and is searchable.
- Settings — open a database by path or from recents, toggle the theme, set the page size.
Tab moves between panes, Ctrl+D (or Ctrl+C) quits, and ? shows every keybinding — start there.
Databases open read-only by default (SQLite itself rejects any write, and destructive queries/ANALYZE are blocked with a status message instead of the confirm dialog). Pass --write to open writable.
Queries run synchronously: a long-running query blocks the interface until it finishes. Press Esc or Ctrl+C while one is running to cancel it (also works for exact row count and ANALYZE).