Skip to main content

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 modern database CLI that speaks your language. DBCrust combines the speed of Rust with intelligent features like context-aware autocompletion, SSH tunneling, Vault integration, and powerful Django ORM analysis. Whether you're debugging production issues, analyzing data, or optimizing Django applications, DBCrust provides an unmatched developer experience.

🤖 Proudly crafted with Claude Code — where AI meets thoughtful development.

Rust License: MIT Documentation PyPI

Why DBCrust?

DBCrust is a high-performance database CLI built for modern developers. Beyond standard database management, it provides context-aware autocompletion, SSH tunneling, HashiCorp Vault integration, and Docker support. Built in Rust for speed, with specialized features for Django developers including real-time ORM analysis and N+1 query detection.

🚀 Key Features

  • 🐳 Multi-Database & File Format Support - PostgreSQL, MySQL, SQLite, MongoDB, ClickHouse, Elasticsearch, plus Parquet, CSV, JSON files via Apache DataFusion
  • ⚡ Intelligent CLI - Context-aware autocompletion, syntax highlighting, and external editor support
  • 🔐 Enterprise Ready - SSH tunneling, HashiCorp Vault integration, and encrypted connections
  • 🔍 Smart Performance Analysis - Built-in EXPLAIN visualization and query optimization tools
  • 🐍 Django ORM Analyzer - Real-time N+1 query detection, performance monitoring, and optimization recommendations
  • 📊 Python Library - Complete programmatic access with unified CLI and Python APIs

Quick Start

Installation

# Native install (fastest, recommended)
curl -fsSL https://clement-tourriere.github.io/dbcrust/install.sh | sh  # Unix
# irm https://clement-tourriere.github.io/dbcrust/install.ps1 | iex  # Windows

# Or via uv (Python package manager)
uvx dbcrust postgres://user:pass@localhost/mydb  # Run immediately
uv tool install dbcrust  # Install as isolated tool (recommended)

Basic Usage

# Multi-database connections with intelligent autocompletion
dbcrust postgres://user:pass@localhost/mydb   # PostgreSQL
dbcrust mysql://user:pass@localhost/mydb      # MySQL
dbcrust elasticsearch://localhost:9200        # Elasticsearch
dbcrust mongodb://localhost:27017/mydb        # MongoDB
dbcrust clickhouse://localhost:8123/default   # ClickHouse
dbcrust docker://postgres-container           # Container auto-discovery
dbcrust session://production_db               # Saved sessions

# File format connections (Parquet, CSV, JSON)
dbcrust parquet:///data/sales_2024.parquet    # Parquet files
dbcrust csv:///logs/*.csv?header=true         # CSV with glob patterns
dbcrust json:///api_responses.json            # JSON/NDJSON files

Essential Commands

# Multi-database connections
dbcrust postgres://postgres:pass@localhost/myapp     # PostgreSQL
dbcrust elasticsearch://localhost:9200               # Elasticsearch (no auth)
dbcrust mongodb://user:pass@localhost:27017/mydb     # MongoDB
dbcrust clickhouse://user:pass@localhost:8123/default # ClickHouse
dbcrust docker://my-postgres-container               # Container auto-discovery

# Interactive commands (once connected)
\dt                               # List tables
\d users                         # Describe table
\e                               # Toggle EXPLAIN mode
\cs                              # Column selection for wide results
\ss production_db                # Save current connection

Advanced Features

# EXPLAIN visualization - toggle with \e
SELECT * FROM users WHERE email = 'user@example.com';
# ○ Execution Time: 1.23 ms • Planning Time: 0.15 ms
# Index Scan using email_idx (Cost: 4, Rows: 1)

# SSH tunneling for secure connections
dbcrust postgres://user:pass@db.internal.com/myapp --ssh-tunnel jumphost.com

# HashiCorp Vault integration
dbcrust vault://app-role@database/postgres-prod

🐍 Django & Python Integration

Django ORM Performance Analysis

# Real-time ORM analysis with middleware (fastest setup)
# settings.py
MIDDLEWARE = ['dbcrust.django.PerformanceAnalysisMiddleware', ...]

# Or manual analysis
from dbcrust.django import analyzer
with analyzer.analyze() as analysis:
    books = Book.objects.all()
    for book in books:
        print(book.author.name)  # Detects N+1 automatically

results = analysis.get_results()  # Get optimization recommendations

Perfect for Django teams: N+1 detection, performance monitoring, CI/CD integration, and real-time optimization suggestions.

📖 Complete Django Integration Guide →

Python API

import dbcrust

# Direct command execution
result = dbcrust.run_command("postgres://user:pass@localhost/mydb", "SELECT * FROM users LIMIT 10")

# Launch interactive CLI from Python
dbcrust.run_cli("postgres://user:pass@localhost/mydb")

# PostgresClient class for object-oriented usage
from dbcrust import PostgresClient
client = PostgresClient(host="localhost", user="postgres", dbname="myapp")
tables = client.list_tables()

📖 Complete Python API Documentation →

Documentation & Support

Development

# Install repo-managed tools (includes Bun for the GUI)
mise install

# Install GUI dependencies
mise run gui:install

# Build the CLI, GUI, and Python targets
mise run build:dev
mise run gui:build-frontend
mise run py:dev

# Run the standard validation flow
mise run check

Built with ❤️ using Rust • Modern database CLI • Security-first architecture

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

dbcrust-0.25.0-cp38-abi3-win_amd64.whl (11.9 MB view details)

Uploaded CPython 3.8+Windows x86-64

dbcrust-0.25.0-cp38-abi3-musllinux_1_2_x86_64.whl (15.3 MB view details)

Uploaded CPython 3.8+musllinux: musl 1.2+ x86-64

dbcrust-0.25.0-cp38-abi3-musllinux_1_2_aarch64.whl (15.3 MB view details)

Uploaded CPython 3.8+musllinux: musl 1.2+ ARM64

dbcrust-0.25.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.5 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ x86-64

dbcrust-0.25.0-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl (15.3 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ i686

dbcrust-0.25.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (15.1 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64

dbcrust-0.25.0-cp38-abi3-macosx_11_0_arm64.whl (12.2 MB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

dbcrust-0.25.0-cp38-abi3-macosx_10_12_x86_64.whl (12.0 MB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

Details for the file dbcrust-0.25.0-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: dbcrust-0.25.0-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

Hashes for dbcrust-0.25.0-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 ff1b6c56e19a24759fb1d6da0ea792807eeb4473356ea9abc5715b8b34a1ae8d
MD5 c52981f9c4ff79bd9b84c47552af3e4b
BLAKE2b-256 f9c254acef62b3e62ae5d5d27a3e067ea5affdaf304a909c24c472f3a5b102e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for dbcrust-0.25.0-cp38-abi3-win_amd64.whl:

Publisher: release.yml on clement-tourriere/dbcrust

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

File details

Details for the file dbcrust-0.25.0-cp38-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for dbcrust-0.25.0-cp38-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 2557f66338aa9b9677de91022e21f57f15510a43350be1871255a729ec5931b3
MD5 d8d5bfb32db29ab4c9c371d30bae7564
BLAKE2b-256 53f7428e5d7b656ed9693bded5a85f6f24db41173e5b0af7229074f7ffd32080

See more details on using hashes here.

Provenance

The following attestation bundles were made for dbcrust-0.25.0-cp38-abi3-musllinux_1_2_x86_64.whl:

Publisher: release.yml on clement-tourriere/dbcrust

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

File details

Details for the file dbcrust-0.25.0-cp38-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for dbcrust-0.25.0-cp38-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 dd0d12431609ec9dfa727af66f2447e46f5851fda3f9b3a86c20b3789865583f
MD5 2e2b4c1294fed1452bc60b5f850089ff
BLAKE2b-256 92d8dd0148c7606ad8f209204717c9514383b234e985605b7789c82f0e7ffd76

See more details on using hashes here.

Provenance

The following attestation bundles were made for dbcrust-0.25.0-cp38-abi3-musllinux_1_2_aarch64.whl:

Publisher: release.yml on clement-tourriere/dbcrust

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

File details

Details for the file dbcrust-0.25.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dbcrust-0.25.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b519aa5fd47a3ad7f3d80bd3aa7907268a920bed8711808ea573042b44f92c3a
MD5 3ebe1d425b82db2fec065f6a2cc249a9
BLAKE2b-256 020a72a35cee90beef18859af86b31c61c80a722192dcef5c99b2ed297619d22

See more details on using hashes here.

Provenance

The following attestation bundles were made for dbcrust-0.25.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on clement-tourriere/dbcrust

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

File details

Details for the file dbcrust-0.25.0-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for dbcrust-0.25.0-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 4c04d880290be9ff04ec31228727f433788f2b9599489081e4d1a9efc060e30f
MD5 e83b2cc116fcd6a7df22b92c9901b3ad
BLAKE2b-256 03499a18423e0fcd29f40d53ea6fca67588b08952ee02d8b4b752be371e75b88

See more details on using hashes here.

Provenance

The following attestation bundles were made for dbcrust-0.25.0-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl:

Publisher: release.yml on clement-tourriere/dbcrust

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

File details

Details for the file dbcrust-0.25.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for dbcrust-0.25.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 7498ece9ed683e15ee625c41812036adf7243c40f3c7a1770a2fbbf30a317c4c
MD5 5af5f98837a25e1f0cfa3a3a0e896ce7
BLAKE2b-256 0d63f0442a83a6479220729d1ce5efaddf53a9c898daeda46e29816f3ad0741f

See more details on using hashes here.

Provenance

The following attestation bundles were made for dbcrust-0.25.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on clement-tourriere/dbcrust

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

File details

Details for the file dbcrust-0.25.0-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dbcrust-0.25.0-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9c920a9b9773f443d1904902116a3a0c04db5fdabc0b6f20d749404b993cb1f1
MD5 a78e020ca3a8d580e67fd93dff2662ae
BLAKE2b-256 438d3c209d985cb72730377b24d4757ed2427aef51859d1a9b0643ffd8058f1c

See more details on using hashes here.

Provenance

The following attestation bundles were made for dbcrust-0.25.0-cp38-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on clement-tourriere/dbcrust

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

File details

Details for the file dbcrust-0.25.0-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for dbcrust-0.25.0-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ca830d3329ba2bec80b1a7fa5838f3d2c0af9b8bbea420b56aff9ced5ad43f9b
MD5 0362b657d619c71aa15f8735af218258
BLAKE2b-256 54dfe6ce1b69127c4ab5a2ad0da66ab46b8afaeac4f0a6585969c95587458c71

See more details on using hashes here.

Provenance

The following attestation bundles were made for dbcrust-0.25.0-cp38-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yml on clement-tourriere/dbcrust

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