# dblab

> Interactive terminal-based database client for PostgreSQL, MySQL, SQLite3, Oracle, and SQL Server

Stars: 3.2k · Categories: Data

- Repository: https://github.com/danvergara/dblab
- Website: https://dblab.app
- Page: https://www.trmn.sh/tools/dblab

## Install

- Homebrew: `brew install --cask danvergara/tools/dblab`
- Shell script: `curl https://raw.githubusercontent.com/danvergara/dblab/master/scripts/install_update_linux.sh | bash`

## Overview

dblab is a terminal-based interactive database client written in Go that supports PostgreSQL, MySQL, SQLite3, Oracle, and SQL Server. It provides a TUI interface for database operations and query execution across multiple database systems through a single binary application.

The tool features a Vim-style query editor with normal and insert modes, supporting line-oriented editing commands. It includes cross-platform support for macOS, Linux, and Windows, distributed as a zero-dependency binary. dblab supports both direct database connections and SSH tunneling for remote database access, with SSL connection options for PostgreSQL.

Connection methods include command-line flags for individual parameters or URL schemes for different database types. The tool supports Unix socket connections for MySQL/MariaDB and PostgreSQL, and includes configuration file support to avoid entering connection details repeatedly. Users can specify result set limits, database schemas, and various SSL parameters for secure connections.

### Installation

```bash
# via Homebrew
brew install --cask danvergara/tools/dblab
```

```bash
# via Shell script
curl https://raw.githubusercontent.com/danvergara/dblab/master/scripts/install_update_linux.sh | bash
```

![dblab interface screenshot](https://github.com/danvergara/dblab/raw/master/screenshots/dblab-cover.png)

![dblab demo animation](https://media.trmn.sh/cached/89c0a747728586eefb7b7abdc53a4ca10fd5071cb6aac64b7f7a91d8088fc11f.gif)

## Alternatives

- [litecli](https://www.trmn.sh/tools/litecli.md): Command-line client for SQLite databases with auto-completion and syntax highlighting. (Python, 3.3k stars)
- [jqp](https://www.trmn.sh/tools/jqp.md): A terminal UI for running jq queries interactively against JSON or NDJSON input, using the gojq implementation, with themes and query history. (Go, 2.9k stars)
- [angle-grinder](https://www.trmn.sh/tools/angle-grinder.md): Command-line log analysis tool that parses, filters, and aggregates log data with a pipeline query language and a live-updating terminal UI. (Rust, 3.8k stars)
- [gojq](https://www.trmn.sh/tools/gojq.md): Pure Go implementation of jq command-line JSON processor with arbitrary-precision arithmetic and YAML support (Go, 3.8k stars)
- [qsv](https://www.trmn.sh/tools/qsv.md): Rust CLI toolkit of composable commands for querying, transforming, validating, joining, and describing CSV, Excel, and other tabular data. (Rust, 3.8k stars)

## Guides

- [Best Database CLI Clients](https://www.trmn.sh/best/database-clients): Compare usql, pgcli, mycli, harlequin and lazysql for querying Postgres, MySQL and SQLite from the terminal, with notes on dblab.

---

Canonical: https://www.trmn.sh/tools/dblab
