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.5

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.5.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.5-py3-none-any.whl (650.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: miu_db-0.1.5.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.5.tar.gz
Algorithm Hash digest
SHA256 0a1aa295b14f5ce72dc6a5bced39f1daf2d0e4859df75d455b5b1bf3397efefd
MD5 13e184a2cd8a825da47d3f641f630d05
BLAKE2b-256 037e99e9d9891bad158d407e96dfd7a7b5b68417aa41b0fa38cd637afa507c6b

See more details on using hashes here.

Provenance

The following attestation bundles were made for miu_db-0.1.5.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.5-py3-none-any.whl.

File metadata

  • Download URL: miu_db-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 650.4 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f7ff22b2894679df0208eadbd9ecc06c1615d4f2639ac75518a720351180da51
MD5 cd89fe5331d8f6ae9999307d290dd7f1
BLAKE2b-256 14016dce53f9332454bc6d76bc66e97412d5ac7885aa8d0c73d1e9c08bd2e68a

See more details on using hashes here.

Provenance

The following attestation bundles were made for miu_db-0.1.5-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