Skip to content

DBCrust

One CLI for PostgreSQL, MySQL, SQLite, ClickHouse, MongoDB, Elasticsearch, Docker databases, Vault-backed connections, and SQL over Parquet/CSV/JSON files — with optional AI, Python/Django, and a desktop GUI.

6 databases

PostgreSQL · MySQL · SQLite · ClickHouse · MongoDB · Elasticsearch

File formats

Parquet · CSV · JSON — query with SQL via Apache DataFusion

Smart CLI

Autocompletion · syntax highlighting · EXPLAIN visualizer · 60+ commands

Built for AI agents

One-shot JSON output · stable exit codes · read-only guard · self-documenting (dbcrust agents)

Optional AI

Text-to-SQL · read-only investigations · SQL shown before execution · local providers

Desktop GUI

Tauri app — CodeMirror editor · schema explorer · Docker panel · multi-tab

Security & privacy

SSH tunneling · HashiCorp Vault · encrypted passwords · explicit AI privacy modes

Python & Django

Library API · Django middleware · N+1 query detection

Terminal window
dbcrust postgres://user:pass@localhost/mydb # PostgreSQL
dbcrust mysql://root:pass@localhost:3306/app # MySQL
dbcrust sqlite:///data/app.db # SQLite
# or simply: dbcrust ./data/app.db
dbcrust clickhouse://user:pass@localhost:8123/db # ClickHouse
dbcrust mongodb://user:pass@localhost:27017/app # MongoDB
dbcrust elasticsearch://localhost:9200 # Elasticsearch
dbcrust ./data/sales.parquet # Parquet (scheme inferred)
dbcrust './logs/*.csv?header=true' # CSV with globs (scheme inferred)
dbcrust file:// # pick a compatible local file
dbcrust json:///events.json # JSON / NDJSON (explicit scheme still works)
dbcrust docker://my-postgres # Docker container
dbcrust session://production_db # Saved session
dbcrust vault://readonly@database/postgres-prod # Vault credentials
\dt -- list tables
\d users -- describe table
\e -- toggle EXPLAIN mode
\ev -- interactive EXPLAIN TUI
\cs -- column selection for wide results
\ns --global daily SELECT * FROM orders WHERE created_at >= current_date - interval '$1 days'
daily 7 -- run named query with parameter

AI is disabled until you run \ai setup. Text-to-SQL (??) uses schema metadata and your question, shows the generated SQL, and asks before execution. Agentic investigations (???) can run bounded read-only inspection queries and may send limited result rows to the configured provider.

?? top 10 customers by total order value this year
??? why is the orders join slow?

Use a local provider (Ollama / LM Studio) or a read-only database role for sensitive environments. See the AI assistant guide and privacy notes.

A Tauri-based app with CodeMirror SQL editor, schema explorer, Docker discovery, EXPLAIN viewer, and multi-tab interface.

Terminal window
mise install && mise run gui:dev

Learn more →

import dbcrust
result = dbcrust.run_command("postgres://…/mydb", "SELECT count(*) FROM users")
from dbcrust.django import analyzer
with analyzer.analyze() as a:
for book in Book.objects.all():
print(book.author.name) # N+1 detected

Python API → · Django integration →