High-performance database CLI engineered for Django developers — Advanced ORM analysis, performance optimization, SSH tunneling, and seamless multi-database support (PostgreSQL, MySQL, SQLite)
Project description
DBCrust
A fast, multi-database CLI and desktop app built in Rust. Connect to PostgreSQL, MySQL, SQLite, ClickHouse, MongoDB, and Elasticsearch — or query Parquet, CSV, and JSON files with SQL. Includes SSH tunneling, Vault integration, Docker auto-discovery, and a Tauri-based GUI.
Features
| Category | What you get |
|---|---|
| Databases | PostgreSQL, MySQL, SQLite, ClickHouse, MongoDB, Elasticsearch |
| File formats | Parquet, CSV, JSON — queried with SQL via Apache DataFusion |
| Smart CLI | Context-aware autocompletion, syntax highlighting, history search, external editor |
| Desktop GUI | Tauri app with CodeMirror SQL editor, schema explorer, Docker panel, EXPLAIN viewer |
| Security | SSH tunneling, HashiCorp Vault dynamic credentials, encrypted password storage |
| DevOps | Docker container auto-discovery, saved sessions, recent connections |
| Performance | EXPLAIN visualization (text + interactive TUI), query timing |
| Django | ORM analyzer, N+1 detection, middleware, management commands |
| Python API | dbcrust.run_command(), dbcrust.run_cli(), PostgresClient class |
Install
# Pre-built binary (macOS / Linux)
curl -fsSL https://clement-tourriere.github.io/dbcrust/install.sh | sh
# Windows
# irm https://clement-tourriere.github.io/dbcrust/install.ps1 | iex
# Python (via uv)
uv tool install dbcrust # install globally
uvx dbcrust <connection-url> # run without installing
# From source
cargo install --path .
Connect
# Relational databases
dbcrust postgres://user:pass@localhost/mydb
dbcrust mysql://root:pass@localhost:3306/mydb
dbcrust sqlite:///path/to/db.sqlite
dbcrust clickhouse://user:pass@localhost:8123/default
# Document databases
dbcrust mongodb://user:pass@localhost:27017/mydb
dbcrust elasticsearch://localhost:9200
# File formats (SQL via DataFusion)
dbcrust parquet:///data/sales.parquet
dbcrust csv:///logs/*.csv?header=true
dbcrust json:///events.json
# Docker auto-discovery
dbcrust docker:// # interactive picker
dbcrust docker://my-postgres-container # direct
# Saved sessions & recent connections
dbcrust session://production_db
dbcrust recent://
# Vault dynamic credentials
dbcrust vault://readonly@database/postgres-prod
# SSH tunneling
dbcrust postgres://user@db.internal/app --ssh-tunnel jumphost.com
Both dbcrust and dbc (short alias) are available.
Interactive commands
Once connected you get a REPL with 50+ backslash commands. Highlights:
\dt list tables \l list databases
\d <table> describe table \c <db> switch database
\e toggle EXPLAIN mode \ev EXPLAIN TUI (interactive)
\x expanded display \cs column selection
\ed open $EDITOR \w <f> write last query to file
\i <f> execute SQL file \n list named queries
\ns <n> <sql> save named query \ss <n> save session
\s list sessions \r recent connections
\savepass save password \vc Vault cache status
\docker list Docker containers \h help
\q quit
Named queries support parameter substitution ($1, $*, $@) and scopes (--global, --postgres, --mysql, --sqlite, or session-local by default).
Desktop GUI
DBCrust includes a Tauri-based desktop application with:
- SQL editor — CodeMirror with syntax highlighting,
Cmd+Enter/Ctrl+Enterto run - EXPLAIN viewer — visual query plan display
- Schema explorer — browse tables, columns, indexes, foreign keys
- Docker discovery — find and connect to running database containers
- Session manager — saved connections, recent history
- Multi-tab — work on multiple queries in parallel
- Settings — view and toggle configuration
- System tray — quick access, stays running in background
Run the GUI
# Prerequisites: mise (installs Bun automatically)
mise install
# Development mode (hot-reload)
mise run gui:dev
# Production build (generates .app / .dmg / .msi)
mise run gui:build
Python integration
import dbcrust
# Execute a query
result = dbcrust.run_command("postgres://user:pass@localhost/mydb", "SELECT * FROM users LIMIT 5")
# Launch interactive CLI
dbcrust.run_cli("postgres://user:pass@localhost/mydb")
# Object-oriented client
from dbcrust import PostgresClient
client = PostgresClient(host="localhost", user="postgres", dbname="myapp")
tables = client.list_tables()
Django ORM analyzer
# settings.py — add the middleware
MIDDLEWARE = ['dbcrust.django.PerformanceAnalysisMiddleware', ...]
# Or analyze manually
from dbcrust.django import analyzer
with analyzer.analyze() as analysis:
for book in Book.objects.all():
print(book.author.name) # N+1 detected
results = analysis.get_results()
# Connect using Django database settings
python manage.py dbcrust
Development
DBCrust uses mise for tool management and task running. Mise automatically installs Bun (used for the GUI frontend), commitizen, and other dev tools.
# One-time setup
mise install # installs Bun, commitizen, pkl, etc.
mise run gui:install # install GUI npm dependencies via Bun
# CLI
mise run build:dev # debug build
mise run build # release build
cargo run -- <url> # run directly
# GUI
mise run gui:dev # dev mode with hot-reload
mise run gui:build # production build
# Python
mise run py:dev # maturin develop
mise run py:build # build wheel
mise run py:test # pytest
# Quality
mise run fmt # cargo fmt
mise run lint # clippy
mise run test # cargo test
mise run check # fmt + lint + test
Project layout
├── src/ # Rust CLI + library
│ ├── main.rs # entry point
│ ├── commands.rs # backslash command system (enum + strum)
│ ├── database_*.rs # per-database implementations
│ ├── completion.rs # SQL autocompletion
│ ├── explain_tui/ # interactive EXPLAIN visualizer (ratatui)
│ └── ...
├── gui/ # Tauri desktop app
│ ├── src/ # React + TypeScript frontend
│ ├── src-tauri/ # Tauri Rust backend (bridges to dbcrust core)
│ └── package.json # Bun-managed dependencies
├── python/ # Python bindings (PyO3 + maturin)
├── docs/ # MkDocs documentation source
├── mise.toml # task runner & tool config
└── Cargo.toml # workspace root
Configuration
Config lives in ~/.config/dbcrust/:
config.toml # settings (limits, display, SSH patterns, Vault, etc.)
named_queries.toml # saved queries with scopes
recent.toml # connection history
vault_credentials.enc # encrypted Vault credential cache
history.txt # command history
Show current config: \config inside the REPL.
Documentation
- Full docs — installation, user guide, reference
- Quick start — get connected in 2 minutes
- Command reference — all 50+ commands
- Django integration — ORM analysis
- Python API — programmatic usage
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dbcrust-0.26.1-cp38-abi3-win_amd64.whl.
File metadata
- Download URL: dbcrust-0.26.1-cp38-abi3-win_amd64.whl
- Upload date:
- Size: 11.9 MB
- Tags: CPython 3.8+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4bcc36a03c5c36626cd17ce8da742c9b045d8acb33ad587bc0c37ea2c50f27a0
|
|
| MD5 |
17e86af5fecb0271df71014a23f7c29c
|
|
| BLAKE2b-256 |
4695c4d6113081b837d8d63e1d24986005c5c37caeb3ec2cf245dd2a3b061eac
|
Provenance
The following attestation bundles were made for dbcrust-0.26.1-cp38-abi3-win_amd64.whl:
Publisher:
release.yml on clement-tourriere/dbcrust
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dbcrust-0.26.1-cp38-abi3-win_amd64.whl -
Subject digest:
4bcc36a03c5c36626cd17ce8da742c9b045d8acb33ad587bc0c37ea2c50f27a0 - Sigstore transparency entry: 1293635425
- Sigstore integration time:
-
Permalink:
clement-tourriere/dbcrust@a6cb06f1f9cddf1772b47ee1bca2f93fd4a1261a -
Branch / Tag:
refs/tags/v0.26.1 - Owner: https://github.com/clement-tourriere
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a6cb06f1f9cddf1772b47ee1bca2f93fd4a1261a -
Trigger Event:
push
-
Statement type:
File details
Details for the file dbcrust-0.26.1-cp38-abi3-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: dbcrust-0.26.1-cp38-abi3-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 15.3 MB
- Tags: CPython 3.8+, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
797e6b729459e56c0af51f3ef20a80cedd0b32d0ba5604e90c9f53df02a884b5
|
|
| MD5 |
5e878f41dcfca808bc75434c7a237db8
|
|
| BLAKE2b-256 |
441e2b4a8386747e5906dadded4e6fbe20f9d6296223c15a1a72b3e1abc2e8e6
|
Provenance
The following attestation bundles were made for dbcrust-0.26.1-cp38-abi3-musllinux_1_2_x86_64.whl:
Publisher:
release.yml on clement-tourriere/dbcrust
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dbcrust-0.26.1-cp38-abi3-musllinux_1_2_x86_64.whl -
Subject digest:
797e6b729459e56c0af51f3ef20a80cedd0b32d0ba5604e90c9f53df02a884b5 - Sigstore transparency entry: 1293635460
- Sigstore integration time:
-
Permalink:
clement-tourriere/dbcrust@a6cb06f1f9cddf1772b47ee1bca2f93fd4a1261a -
Branch / Tag:
refs/tags/v0.26.1 - Owner: https://github.com/clement-tourriere
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a6cb06f1f9cddf1772b47ee1bca2f93fd4a1261a -
Trigger Event:
push
-
Statement type:
File details
Details for the file dbcrust-0.26.1-cp38-abi3-musllinux_1_2_aarch64.whl.
File metadata
- Download URL: dbcrust-0.26.1-cp38-abi3-musllinux_1_2_aarch64.whl
- Upload date:
- Size: 15.3 MB
- Tags: CPython 3.8+, musllinux: musl 1.2+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38c25db1de07dc87464386b8f4ad237a6cda3d1d53b4fcb5dc9e323642a5da26
|
|
| MD5 |
c1d30046ce2e0b6bc3ff2c8c759a9d14
|
|
| BLAKE2b-256 |
0b484d2195552eeb3fe9e95966c5055b92381cb9404081c36c09cd1cf2454a02
|
Provenance
The following attestation bundles were made for dbcrust-0.26.1-cp38-abi3-musllinux_1_2_aarch64.whl:
Publisher:
release.yml on clement-tourriere/dbcrust
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dbcrust-0.26.1-cp38-abi3-musllinux_1_2_aarch64.whl -
Subject digest:
38c25db1de07dc87464386b8f4ad237a6cda3d1d53b4fcb5dc9e323642a5da26 - Sigstore transparency entry: 1293635439
- Sigstore integration time:
-
Permalink:
clement-tourriere/dbcrust@a6cb06f1f9cddf1772b47ee1bca2f93fd4a1261a -
Branch / Tag:
refs/tags/v0.26.1 - Owner: https://github.com/clement-tourriere
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a6cb06f1f9cddf1772b47ee1bca2f93fd4a1261a -
Trigger Event:
push
-
Statement type:
File details
Details for the file dbcrust-0.26.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: dbcrust-0.26.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 14.5 MB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9e6fb87536993d09b4dbf1bf5892593dc20ebbb1142cbdfdf5bdb5ae9ed41e6
|
|
| MD5 |
a698726bcd6a62ae698345ac1c35ae8e
|
|
| BLAKE2b-256 |
1cb6d06c5154a4cfbb6df4438aa7c5387109064b03a7517d7cc8b7c56d367afc
|
Provenance
The following attestation bundles were made for dbcrust-0.26.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
release.yml on clement-tourriere/dbcrust
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dbcrust-0.26.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
e9e6fb87536993d09b4dbf1bf5892593dc20ebbb1142cbdfdf5bdb5ae9ed41e6 - Sigstore transparency entry: 1293635444
- Sigstore integration time:
-
Permalink:
clement-tourriere/dbcrust@a6cb06f1f9cddf1772b47ee1bca2f93fd4a1261a -
Branch / Tag:
refs/tags/v0.26.1 - Owner: https://github.com/clement-tourriere
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a6cb06f1f9cddf1772b47ee1bca2f93fd4a1261a -
Trigger Event:
push
-
Statement type:
File details
Details for the file dbcrust-0.26.1-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl.
File metadata
- Download URL: dbcrust-0.26.1-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 15.3 MB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
070861582ecff77ffd2b7a487991fd2c8f830e90c2aa40253d1d52ac6dc80c19
|
|
| MD5 |
7df4df252e4e4dcad94747bed3a3d1da
|
|
| BLAKE2b-256 |
cea04deccf1ffc18dcaf740af879e81f0a5315874e2a5aa91aadcb85be889f0d
|
Provenance
The following attestation bundles were made for dbcrust-0.26.1-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl:
Publisher:
release.yml on clement-tourriere/dbcrust
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dbcrust-0.26.1-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl -
Subject digest:
070861582ecff77ffd2b7a487991fd2c8f830e90c2aa40253d1d52ac6dc80c19 - Sigstore transparency entry: 1293635434
- Sigstore integration time:
-
Permalink:
clement-tourriere/dbcrust@a6cb06f1f9cddf1772b47ee1bca2f93fd4a1261a -
Branch / Tag:
refs/tags/v0.26.1 - Owner: https://github.com/clement-tourriere
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a6cb06f1f9cddf1772b47ee1bca2f93fd4a1261a -
Trigger Event:
push
-
Statement type:
File details
Details for the file dbcrust-0.26.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: dbcrust-0.26.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 15.1 MB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5337ee85a7c25ff593e3b9e404656ea26428790dcf5b2856961a17763280d166
|
|
| MD5 |
cf9f53eafcaf5f91872326fc3bb78b88
|
|
| BLAKE2b-256 |
0b087e26c219de30a162e2623ffe4d0c8c92628de41aed0b9a258e8910c150e1
|
Provenance
The following attestation bundles were made for dbcrust-0.26.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
release.yml on clement-tourriere/dbcrust
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dbcrust-0.26.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
5337ee85a7c25ff593e3b9e404656ea26428790dcf5b2856961a17763280d166 - Sigstore transparency entry: 1293635481
- Sigstore integration time:
-
Permalink:
clement-tourriere/dbcrust@a6cb06f1f9cddf1772b47ee1bca2f93fd4a1261a -
Branch / Tag:
refs/tags/v0.26.1 - Owner: https://github.com/clement-tourriere
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a6cb06f1f9cddf1772b47ee1bca2f93fd4a1261a -
Trigger Event:
push
-
Statement type:
File details
Details for the file dbcrust-0.26.1-cp38-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: dbcrust-0.26.1-cp38-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 12.2 MB
- Tags: CPython 3.8+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22c81231023a9e32f178e93e3e95dc4d5d4933b2c13068736109d2fef1cdb61c
|
|
| MD5 |
5df3ae0975b7fd80775436da89fc3409
|
|
| BLAKE2b-256 |
8f61bf5a1dea4c4ef51835d380a74cb491ad878d3fb4a6aa87c221af68db23c4
|
Provenance
The following attestation bundles were made for dbcrust-0.26.1-cp38-abi3-macosx_11_0_arm64.whl:
Publisher:
release.yml on clement-tourriere/dbcrust
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dbcrust-0.26.1-cp38-abi3-macosx_11_0_arm64.whl -
Subject digest:
22c81231023a9e32f178e93e3e95dc4d5d4933b2c13068736109d2fef1cdb61c - Sigstore transparency entry: 1293635429
- Sigstore integration time:
-
Permalink:
clement-tourriere/dbcrust@a6cb06f1f9cddf1772b47ee1bca2f93fd4a1261a -
Branch / Tag:
refs/tags/v0.26.1 - Owner: https://github.com/clement-tourriere
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a6cb06f1f9cddf1772b47ee1bca2f93fd4a1261a -
Trigger Event:
push
-
Statement type:
File details
Details for the file dbcrust-0.26.1-cp38-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: dbcrust-0.26.1-cp38-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 12.0 MB
- Tags: CPython 3.8+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c036ecda785d6e8f8a488f306b822eb329e43cfb2e3430393f3f549e379549ca
|
|
| MD5 |
218f065a4031b62ea08b81406d9c1845
|
|
| BLAKE2b-256 |
0debe0d0f54e8896ad447bb7fc23291f3ce5cadf7e1b53be2ad58f6de2e39183
|
Provenance
The following attestation bundles were made for dbcrust-0.26.1-cp38-abi3-macosx_10_12_x86_64.whl:
Publisher:
release.yml on clement-tourriere/dbcrust
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dbcrust-0.26.1-cp38-abi3-macosx_10_12_x86_64.whl -
Subject digest:
c036ecda785d6e8f8a488f306b822eb329e43cfb2e3430393f3f549e379549ca - Sigstore transparency entry: 1293635471
- Sigstore integration time:
-
Permalink:
clement-tourriere/dbcrust@a6cb06f1f9cddf1772b47ee1bca2f93fd4a1261a -
Branch / Tag:
refs/tags/v0.26.1 - Owner: https://github.com/clement-tourriere
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a6cb06f1f9cddf1772b47ee1bca2f93fd4a1261a -
Trigger Event:
push
-
Statement type: