English | 日本語
A TUI MySQL client for fast database exploration with fuzzy search, written in Rust.
- Bastion Support: Connect to MySQL through SSH bastion servers with per-connection or shared bastion configuration
- TUI Interface: Interactive terminal UI powered by ratatui
- Fuzzy Finder: Quick connection and table selection with skim (Rust-native fzf)
- TOML Configuration: Manage multiple connections in a single config file
- Connection Pooling: Configurable connection pool with global defaults and per-connection overrides
- Shell Input: Run shell commands from within sqsh (executes on bastion when connected via bastion)
- Read-only Mode: Prevent accidental writes with client-side SQL detection and server-side session enforcement
- Secure: Memory-zeroed password handling, TLS/SSL support, config file permission checks
brew tap hatohato25/sqsh
brew trust --formula hatohato25/sqsh/sqsh
brew install sqshNote:
brew trustis required by Homebrew 4.x and later to explicitly trust third-party tap formulae before installation.
curl -fsSL https://raw.githubusercontent.com/hatohato25/sqsh/main/install.sh | bashThe script automatically detects your architecture, downloads the appropriate binary from GitHub Releases, verifies its checksum, and installs it to /usr/local/bin (with sudo) or ~/.local/bin (without sudo).
cargo build --release
cp target/release/sqsh /usr/local/bin/- Rust 1.75.0 or later (for building from source)
- MySQL 5.7+ / MariaDB 10.3+
Create a configuration file at ~/.config/sqsh/config.toml and restrict its permissions:
chmod 600 ~/.config/sqsh/config.tomlsqsh warns if the file permissions are not 600.
See the Configuration docs for the full settings reference and example configurations. A minimal annotated example is also available in config.example.toml.
sqsh # Start with default config (~/.config/sqsh/config.toml)
sqsh --config /path/to.toml # Specify a config file
sqsh --verbose # Enable debug logging
sqsh --readonly # Start in read-only mode (overrides per-connection settings)
sqsh --lang ja # Use Japanese display languageConfig file search order when --config is not specified:
~/.config/sqsh/config.toml./config.toml
Note: If you use fish or another non-POSIX shell, the skim-based preview (fuzzy finder preview window) may not render correctly. In that case, prefix the command with
SHELL=/bin/bash:SHELL=/bin/bash sqsh
See the Key Bindings docs for the full list of key bindings across the connection selector, SQL input, shell input, and result viewer.
The repository ships with a docker-compose.yml and initialization scripts under docker/init/ that spin up a MySQL 8.0 instance pre-loaded with several sample databases.
| Database | Description |
|---|---|
testdb |
Basic users / products / orders |
ecommerce |
Customers, items, transactions, reviews |
blog |
Authors, posts, comments, tags |
analytics |
Events (~1M rows), sessions, page views |
inventory |
Warehouses, products, stock levels, shipments |
hr_system |
Departments, employees, projects, time entries |
1. Start the MySQL container
docker compose up -dWait until the container reports healthy (the init scripts run automatically on first start; the analytics.events table takes a minute to populate ~1M rows):
docker compose ps # STATUS should show "healthy"2. Create a config file
mkdir -p ~/.config/sqsh
cp config.example.toml ~/.config/sqsh/config.toml
chmod 600 ~/.config/sqsh/config.tomlThen edit ~/.config/sqsh/config.toml so the local-dev connection points to the Docker instance:
[[connections]]
name = "local-dev"
[connections.mysql]
host = "127.0.0.1"
port = 13306 # mapped port in docker-compose.yml
database = "testdb"
user = "testuser"
password = "testpass"
ssl_mode = "disabled"3. Launch sqsh
sqshSelect local-dev from the connection picker and start exploring.
docker compose down # stop containers, keep volume
docker compose down -v # stop containers and remove volume# Run all tests
cargo test
# Run integration tests (requires Docker or Podman)
cargo test --test integration_testMIT
