🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more
Socket
Book a DemoInstallSign in
Socket

dbcrust

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dbcrust

High-performance database CLI engineered for Django developers — Advanced ORM analysis, performance optimization, SSH tunneling, and seamless multi-database support (PostgreSQL, MySQL, SQLite)

pipPyPI
Version
0.22.0
Maintainers
1

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

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

Keywords

dbcrust

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts