v0.6.0 · see what's new

SQL in your terminal.
Fast, and safe on production.

squi is a keyboard-driven SQL client: browse schemas, write queries with completion, edit rows and read query plans, locally or on a server you reached over SSH. One small static binary.

$ brew install farvisun/tap/squi
Read the guide
  • PostgreSQL
  • MySQL
  • MariaDB
  • ClickHouse
  • SQL Server
  • SQLite

Everything you reach for in a GUI client

A DataGrip-style workflow without the weight, built for the keyboard.

Explore

Databases, schemas, tables, views and routines, with columns, indexes, foreign keys, DDL and sizes a key away.

Query

Tabs with syntax highlighting, context-aware completion, vim or standard keys, a formatter and your $EDITOR.

Browse results

A streaming grid: lazy loading, sort, filter, a cell inspector, and export to CSV, TSV, JSON or SQL.

Navigate data

Filter and sort whole tables on the server, follow foreign keys and jump to referencing rows.

Edit inline

Change rows in the grid, review the generated SQL, then apply it in one transaction that rolls back on any surprise.

Read plans

EXPLAIN and EXPLAIN ANALYZE as a tree with the hot path highlighted.

Connect through SSH

Bastions, ~/.ssh/config aliases and ProxyJump chains, with keys, agents and host-key checks.

Admin views

Sessions, cancel and kill, server variables, users and grants, table sizes.

Bring DataGrip along

squi import datagrip imports data sources with their SSH tunnels, passwords and query consoles.

New

Query parameters

Write :name, $1 or ? and squi asks for the values before the query runs, then remembers them, so the next run is one key. Strings, comments, casts and dollar-quoted bodies are left alone.

How parameters work →
SELECT id, total, status
FROM orders
WHERE customer_id = :customer
  AND created_at > :since;

┌ Query parameters ─────────────────┐
│ :customer  42                     │
│ :since     now() - interval '7d'  │
│ enter run · esc cancel            │
└───────────────────────────────────┘
New

Schema diff

squi diff staging prod compares tables, columns, primary keys, indexes, foreign keys and views, then writes the ALTER script that brings the target in line. It never runs anything; drops stay commented out until you ask for them, and -exit-code fails a CI job when schemas drift.

Compare schemas →
$ squi diff staging prod
-- staging → prod: 3 difference(s)
--   missing column  users.org_id
--   nullability     users.email: null → not null
--   missing index   users.users_org_idx

ALTER TABLE "public"."users" ADD COLUMN "org_id" bigint;
ALTER TABLE "public"."users" ALTER COLUMN "email" SET NOT NULL;
CREATE INDEX "users_org_idx" ON "public"."users" ("org_id");

Built for production databases

The guard rails are on by default, because the scary server is the one you open most.

Read-only connections

The session itself is read-only where the engine supports it, and squi blocks writes before they reach the server.

Typed confirmation

DROP, TRUNCATE, and DELETE or UPDATE without a real WHERE need the database name typed out.

Prod environments

A red status bar, a confirmation before every write, and a 30-second statement timeout by default.

Manual transactions

Run changes inside a transaction and commit or roll back from the transaction menu.

Secrets stay out of files

Passwords go to the OS keychain or environment variables, never the config.

Reviewed edits

Inline edits, imports and diffs show their SQL before anything runs.

Install

macOS, Linux and Windows. No runtime, no daemon.

Homebrewbrew install farvisun/tap/squi
Scoopscoop bucket add farvisun https://github.com/farvisun/scoop-bucket; scoop install squi
Go 1.26+go install github.com/farvisun/squi/cmd/squi@latest
Linux packages.deb, .rpm and .apk on the releases pageReleases

Then

$ squi                                   # connection manager
$ squi --connect prod-api                # a saved connection
$ squi --connect 'mysql://root@127.0.0.1/shop'   # a URL, never saved
$ squi --connect ./app.db                # a SQLite file
F1 ?Every key bindingctrl+pCommand palette
ctrl+enter F5Run the statement under the cursortabExplorer, editor, results
ctrl+t alt+1…9New tab, switch tabctrl+gTransaction menu