dblab CLI

dblab is a terminal SQL client with saved connection profiles and optional password storage in the operating system keyring.

  • 3,247 ★ on the repository
  • Last commit
  • MIT
CLI

Extended access

Why this level

  • The client executes SQL with the database role’s rights and retains local query history.
All reasons and checks

danvergara/dblab

Install

Manual install

brew install --cask danvergara/tools/dblab

First Installation-section method.

Access and checks

How we review

Extended accessThe tool runs code or makes network calls and only reads external data.

  • The client executes SQL with the database role’s rights and retains local query history.

This is third-party code. Review the repository files before installing.

What it does

dblab is a SQL client that opens databases in a three-pane terminal UI: table navigation, SQL editing and results with metadata. It supports PostgreSQL, MySQL and SQLite. Users can also connect to Oracle and SQL Server. The editor uses Vim modes and can execute the current query only. Saved profiles keep connection parameters, with passwords in the OS keyring. The `--readonly` flag opens a read-only connection to prevent accidental writes.

Who it is for. Analysts working across SQL systems who want one terminal interface for tables, schemas and queries.

Good fit when

  • An unfamiliar database needs tree and metadata inspection.
  • SQL is easier to edit beside results in a modal editor.
  • Several environments need named connection profiles.
  • Exploration requires an explicitly read-only session.

Not a fit when

  • One session must manage multiple databases simultaneously.
  • Statement order matters but queries would be run as one parallel batch.
  • You need a non-interactive API rather than a terminal UI.

Example request

Prepare a dblab profile for the test database with encryption and read-only mode. Show settings without the password.

Limitations

Each session connects to one database; confirm its connection and database name before querying. Up to five editor statements may run concurrently, so execute dependent queries separately. Local history retains SQL, including its literal values, which matters for confidential data. SSL is disabled by default in connection settings. Configure encryption before opening the first remote database connection.

How to disable. Finish or cancel the query and exit dblab. When removing a profile, separately remove unwanted keyring credentials and saved SQL from local history.

FAQ

How do I enable read-only access?

Use `--readonly` and restrict database-role permissions as well.

How do I open a saved profile?

Run `dblab connect` and select the named connection. The profile supplies its saved parameters for the new session.

How do I run the current query only?

Ctrl-R runs the cursor-line query by default; Ctrl-E runs the editor contents.

Is there table pagination?

No. Use SELECT with explicit LIMIT and OFFSET for large tables.

Where are indexes shown?

Select a table and open the Indexes result tab; other tabs show columns and constraints.

How do I switch schemas without restarting?

For PostgreSQL or Oracle, press Ctrl-S and select a schema. Switching is available when no schema was pinned at startup; the status bar shows the selected name.

Discussion

No questions or reviews yet.

CLI tools

pgcli is a terminal PostgreSQL client with SQL-aware suggestions: tables after FROM and columns after WHERE.

CLIExtended access13.4KRepository stars
Editors’ pick

A token-lean MCP server for PostgreSQL, MySQL, MariaDB, SQL Server and SQLite with a read-only mode

MCP serverBroad access3.8KRepository stars

The SQL client combines terminal database browsing with batch queries for agents using named connections and JSON results.

CLIExtended access5KRepository stars

VisiData opens multiple table formats in a terminal and helps explore, arrange and compare data through keyboard controls.

CLIExtended access9.4KRepository stars
Official

A desktop SQL workspace with a built-in MCP server: the agent reads the schema and runs queries in the same client you already use

MCP serverBroad access5.4KRepository stars

Harlequin provides a terminal SQL editor, while its bundled hsql runs queries and explores database structure for agents.

CLIExtended access6.5KRepository stars

README in short

Each pane has separate key bindings in YAML configuration. Users can assign their own keys for the editor, table tree and result pane.

README badge

Report a problem

Foxx AIdblab
Foxx AI

I am Foxx AI and I have already vetted this tool. Ask about install, setup or anything else, and I will keep it simple.