Skip to main content

Fast terminal SQL across your databases.

Project description

miu-db logo

miu-db

Fast terminal SQL across your databases.
Pick a connection, write SQL, inspect results, stay in your shell.

CI PyPI Python License

miu-db is part of the miumono umbrella: small, focused terminal-native tools that are easy to install, easy to run locally, and predictable in CI.

Quick Start

Install from PyPI:

uv tool install miu-db
miu-db

Try the TUI without a real database:

miu-db --mock=sqlite-demo

Run one query from the CLI:

miu-db query -c local -q "select 1"

Source Install

For local development, install this checkout in editable mode. Code edits apply the next time you run miu-db.

cd /Users/vanducng/git/personal/miu-db
uv tool install --force --editable ".[all]"
miu-db --mock=sqlite-demo

Re-run the install command after changing dependencies, entry points, or pyproject.toml.

Connections

Save local connections:

miu-db connections add sqlite --name local --file-path ./app.db
miu-db connections add postgresql --name pg --server localhost --database app --username app
miu-db connections add mysql --name mysql --server localhost --database app --username app

Connect without saving:

miu-db connect sqlite --file-path ./app.db
miu-db postgresql://user:pass@localhost:5432/app
miu-db mysql://root@localhost/app

Manage saved connections:

miu-db connections list
miu-db connections delete local

Passwords are stored in the OS keyring under the miu-db service when possible.

Capabilities

  • Terminal UI with explorer, SQL editor, and results grid.
  • Vim-style normal/insert modes.
  • Per-connection query history.
  • Fuzzy filtering over result rows.
  • Saved connections with keyring-backed passwords.
  • Docker database discovery.
  • SSH tunnels.
  • Driver install hints when an adapter dependency is missing.

SQLite works out of the box. Optional adapters cover PostgreSQL, MySQL, SQL Server, MariaDB, Oracle, DuckDB, ClickHouse, Snowflake, BigQuery, Athena, Spanner, Turso, D1, Firebird, Redshift, Db2, HANA, Teradata, Trino, Presto, Flight SQL, Impala, SurrealDB, osquery, and more.

Keys

Key Action
i Insert mode
Esc Normal mode
e / q / r Focus explorer / query / results
Enter Run statement under cursor
h Query history
s Select top rows from table
v View selected cell
y / Y Copy cell / row
<space> Command menu
? Help
Ctrl+Q Quit

Config

This is a brand-new miu-db app, not a legacy config alias.

  • config: ~/.config/miu/db
  • override: MIU_DB_CONFIG_DIR
  • env vars: MIU_DB_*
  • keyring service: miu-db
miu-db config edit
miu-db config show-keymap

On first run, miu-db copies missing files from ~/.config/sqlit into ~/.config/miu/db so existing saved connections keep working. Existing files in the new location are never overwritten.

Develop

uv sync --all-extras --dev
uv run miu-db --mock=sqlite-demo
uv run pytest tests/unit/test_config_dir_resolution.py -q
uv run pytest tests/test_sqlite.py -q --timeout=60

Build the package:

uv run python -m build

Release tags use miumono component SemVer:

miu-db-v0.1.4

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

miu_db-0.1.4.tar.gz (3.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

miu_db-0.1.4-py3-none-any.whl (650.2 kB view details)

Uploaded Python 3

File details

Details for the file miu_db-0.1.4.tar.gz.

File metadata

  • Download URL: miu_db-0.1.4.tar.gz
  • Upload date:
  • Size: 3.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for miu_db-0.1.4.tar.gz
Algorithm Hash digest
SHA256 c473ab060ebe661967b236c64bbdb677fe2720ebbab8ef314f6ad6a1395179b4
MD5 ec08f91f95f49a70dca01ac1f469607c
BLAKE2b-256 9052846e9b0fa798a82482c70f2ac0c3773deb801ce1578ac5db8d5a0cbe93ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for miu_db-0.1.4.tar.gz:

Publisher: publish.yml on vanducng/miu-db

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file miu_db-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: miu_db-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 650.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for miu_db-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e330f6cc6de56354b74271e313e1ae1043efe9d56e223d85e9ca198c8e076427
MD5 847b7fd1130cc69a347310425c9c91fe
BLAKE2b-256 5b8edda4661ee62970a1e87450e630dfd892bc8ddb1e331252d91149abcd87f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for miu_db-0.1.4-py3-none-any.whl:

Publisher: publish.yml on vanducng/miu-db

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page