Skip to main content

dbqm — Database Query Manager

A fullscreen terminal app and a scriptable CLI for running SQL across Oracle, SQL Server, PostgreSQL and MySQL — from one place, with one set of saved connections.

Built with Textual. Credentials are encrypted at rest; nothing is ever written to your shell history.

📖 Full documentation on GitHub


Install

pip install dbqm

Python 3.10+. Database drivers come with it.

Windows on ARM: some drivers have no win-arm64 wheel and are skipped automatically. Use Python AMD64 (it runs under x64 emulation) — see the README.

Oracle connections additionally need the Oracle Instant Client. dbqm can download and install it for you from Settings › Oracle Instant Client.

Use it interactively

dbqm

An eight-tab dashboard (F1F8): ad-hoc SQL, connections, an object browser, multi-database comparison, history, saved queries and tools. Fully keyboard-driven, dark and light themes.

On first launch it creates ~/.dbqm/, generates an encryption key and walks you through your first connection.

Use it from a script

Every operation below is non-interactive — no prompts, no TTY required, which is what makes dbqm usable from CI or from an AI agent.

# Create a connection. The password is piped, never passed in argv.
echo "s3cret" | dbqm connection add prod --type oracle --mode direct \
    --host db.example.com --port 1521 --service ORCL --user admin \
    --password-stdin --test

# Run SQL. -f json for a machine, -f raw to pipe a CLOB somewhere else.
dbqm sql "SELECT * FROM pedidos WHERE status = :s" prod -p s=PAGO -f json

# Save a query once, run it with different parameters later.
dbqm run pedidos-em-aberto -p data_inicio=2026-01-01

# Compare the same logical query across environments.
dbqm run-group conciliacao-diaria -p data=2026-01-01

# Get an execution plan in one step (no EXPLAIN PLAN FOR boilerplate).
dbqm sql "SELECT * FROM pedidos WHERE cliente_id = :id" prod --explain -p id=42

# Extract DDL, browse connections, review history.
dbqm ddl PKG_FATURAMENTO prod
dbqm connection list -f json
dbqm history -n 20

--help on any command lists its flags.

What it does

  • Saved queries with parameters, organised in folders, with favourites and a DE-PARA column mapping for values that differ between systems.
  • Cross-database comparison — run the same logical query against several connections and get a per-row OK / DIFF / ABSENT verdict, as a table or an interactive HTML report.
  • Object browser — tables, views, routines and Oracle packages: columns, primary keys, foreign keys and indexes, without writing catalogue SQL.
  • Ad-hoc SQL — SELECT, CTEs, DML, DDL with compilation-error detection, and anonymous PL/SQL blocks with DBMS_OUTPUT captured and shown.
  • Execute routines — packages, procedures and functions, with parameter input and output capture.
  • Package editor for Oracle PL/SQL, with inline compilation errors.
  • Exports — CSV, JSON, TXT, SQL and HTML reports, plus IDE-style execution evidence (the SQL, the connection, the timestamp, the outcome) for an audit trail you can hand to someone else.
  • Portable configuration — export and import your connections and queries as an encrypted .dbqm bundle.

Security

  • Connection passwords are encrypted at rest with Fernet.
  • Passwords are read from stdin or an environment variable, never from argv — they do not reach your shell history or the process table.
  • Queries use bind variables; SQL identifiers are validated against an allowlist.
  • HTML reports escape every user-controlled value.

Links

MIT licensed.

Download files

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

Source Distribution

dbqm-1.22.1.tar.gz (219.2 kB view details)

Uploaded Source

Built Distribution

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

dbqm-1.22.1-py3-none-any.whl (238.9 kB view details)

Uploaded Python 3

File details

Details for the file dbqm-1.22.1.tar.gz.

File metadata

  • Download URL: dbqm-1.22.1.tar.gz
  • Upload date:
  • Size: 219.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.14

File hashes

Hashes for dbqm-1.22.1.tar.gz
Algorithm Hash digest
SHA256 0c037b17ec2ce28283bb63274b6655c448fb80ed81eb183b9ecef479fbf68aea
MD5 49a7044d820c0716a7e4ee08d122587e
BLAKE2b-256 5f0233f8ee5f2d18a60f818449ea418e9ddf7563611a29395291e0ec665dd31e

See more details on using hashes here.

File details

Details for the file dbqm-1.22.1-py3-none-any.whl.

File metadata

  • Download URL: dbqm-1.22.1-py3-none-any.whl
  • Upload date:
  • Size: 238.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.14

File hashes

Hashes for dbqm-1.22.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d062e813ce3ad5d54618018df977d6d20b52f04e9491c9981cd8cfda5746cb8e
MD5 595eb328968e6e73a3ee3392cba9ca73
BLAKE2b-256 539a5fe6e33c7b33004294059f860afc03c241257d38bacbb52de250d7303ae5

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.22.1 This release

2 files

1.22.0

2 files

1.21.0

2 files

1.18.0

2 files

1.17.0

2 files

1.16.1

2 files

1.16.0

2 files

1.15.2

2 files

1.15.1

2 files

1.15.0

2 files

1.14.1

2 files

1.14.0

2 files

1.13.0

2 files

1.12.0

2 files

1.11.1

2 files

1.11.0

2 files

1.10.0

2 files

1.9.0

2 files

1.8.4

2 files

1.8.3

2 files

1.8.2

2 files

1.8.1

2 files

1.8.0

2 files

1.7.0

2 files

1.6.3

2 files

1.6.2

2 files

1.6.1

2 files

1.6.0

2 files

1.5.5

2 files

1.5.4

2 files

1.5.3

2 files

1.5.2

2 files

1.5.1

2 files

1.5.0

2 files

1.4.1

2 files

1.4.0

2 files

1.3.4

2 files

1.3.3

2 files

1.3.2

2 files

1.3.1

2 files

1.3.0

2 files

1.2.1

2 files

1.2.0

2 files

1.1.1

2 files

1.1.0

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page