# 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](https://claude.ai/code) β where AI meets thoughtful development.*
[](https://www.rust-lang.org/)
[](LICENSE)
[](https://clement-tourriere.github.io/dbcrust/)
[](https://pypi.org/project/dbcrust/)
## 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 Support** - PostgreSQL, MySQL, SQLite, MongoDB, ClickHouse, Elasticsearch with container auto-discovery
- **β‘ 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
```bash
# 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
```bash
# 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
```
## Essential Commands
```bash
# 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
```bash
# 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
```python
# 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 β**](https://clement-tourriere.github.io/dbcrust/django-analyzer/)
## Python API
```python
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 β**](https://clement-tourriere.github.io/dbcrust/python-api/)
## Documentation & Support
- **[π Complete Documentation](https://clement-tourriere.github.io/dbcrust/)** - Installation, usage guides, and API reference
- **[π§ Command Reference](https://clement-tourriere.github.io/dbcrust/reference/backslash-commands/)** - All 40+ interactive commands
- **[π Django Integration](https://clement-tourriere.github.io/dbcrust/django-analyzer/)** - ORM performance analysis
- **[π Issues & Support](https://github.com/clement-tourriere/dbcrust/issues)** - Bug reports and questions
- **[π¦ PyPI Package](https://pypi.org/project/dbcrust/)** - Python package information
---
**Built with β€οΈ using [Rust](https://www.rust-lang.org/) β’ Modern database CLI β’ Security-first architecture**
Raw data
{
"_id": null,
"home_page": null,
"name": "dbcrust",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "dbcrust, database, postgres, mysql, sqlite, cli, interactive, sql, postgresql, mysql, sqlite, ssh-tunnel, vault, docker, django, orm, python-library, performance-analysis, n-plus-one",
"author": null,
"author_email": "Cl\u00e9ment Tourri\u00e8re <clement.tourriere@gmail.com>",
"download_url": null,
"platform": null,
"description": "# DBCrust\n\n**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.**\n\n*\ud83e\udd16 Proudly crafted with [Claude Code](https://claude.ai/code) \u2014 where AI meets thoughtful development.*\n\n[](https://www.rust-lang.org/)\n[](LICENSE)\n[](https://clement-tourriere.github.io/dbcrust/)\n[](https://pypi.org/project/dbcrust/)\n\n## Why DBCrust?\n\nDBCrust 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.\n\n## \ud83d\ude80 Key Features\n\n- **\ud83d\udc33 Multi-Database Support** - PostgreSQL, MySQL, SQLite, MongoDB, ClickHouse, Elasticsearch with container auto-discovery\n- **\u26a1 Intelligent CLI** - Context-aware autocompletion, syntax highlighting, and external editor support\n- **\ud83d\udd10 Enterprise Ready** - SSH tunneling, HashiCorp Vault integration, and encrypted connections\n- **\ud83d\udd0d Smart Performance Analysis** - Built-in EXPLAIN visualization and query optimization tools\n- **\ud83d\udc0d Django ORM Analyzer** - Real-time N+1 query detection, performance monitoring, and optimization recommendations\n- **\ud83d\udcca Python Library** - Complete programmatic access with unified CLI and Python APIs\n\n## Quick Start\n\n### Installation\n\n```bash\n# Native install (fastest, recommended)\ncurl -fsSL https://clement-tourriere.github.io/dbcrust/install.sh | sh # Unix\n# irm https://clement-tourriere.github.io/dbcrust/install.ps1 | iex # Windows\n\n# Or via uv (Python package manager)\nuvx dbcrust postgres://user:pass@localhost/mydb # Run immediately\nuv tool install dbcrust # Install as isolated tool (recommended)\n```\n\n### Basic Usage\n\n```bash\n# Multi-database connections with intelligent autocompletion\ndbcrust postgres://user:pass@localhost/mydb # PostgreSQL\ndbcrust mysql://user:pass@localhost/mydb # MySQL\ndbcrust elasticsearch://localhost:9200 # Elasticsearch\ndbcrust mongodb://localhost:27017/mydb # MongoDB\ndbcrust clickhouse://localhost:8123/default # ClickHouse\ndbcrust docker://postgres-container # Container auto-discovery\ndbcrust session://production_db # Saved sessions\n```\n\n## Essential Commands\n\n```bash\n# Multi-database connections\ndbcrust postgres://postgres:pass@localhost/myapp # PostgreSQL\ndbcrust elasticsearch://localhost:9200 # Elasticsearch (no auth)\ndbcrust mongodb://user:pass@localhost:27017/mydb # MongoDB\ndbcrust clickhouse://user:pass@localhost:8123/default # ClickHouse\ndbcrust docker://my-postgres-container # Container auto-discovery\n\n# Interactive commands (once connected)\n\\dt # List tables\n\\d users # Describe table\n\\e # Toggle EXPLAIN mode\n\\cs # Column selection for wide results\n\\ss production_db # Save current connection\n```\n\n## Advanced Features\n\n```bash\n# EXPLAIN visualization - toggle with \\e\nSELECT * FROM users WHERE email = 'user@example.com';\n# \u25cb Execution Time: 1.23 ms \u2022 Planning Time: 0.15 ms\n# Index Scan using email_idx (Cost: 4, Rows: 1)\n\n# SSH tunneling for secure connections\ndbcrust postgres://user:pass@db.internal.com/myapp --ssh-tunnel jumphost.com\n\n# HashiCorp Vault integration\ndbcrust vault://app-role@database/postgres-prod\n```\n\n## \ud83d\udc0d Django & Python Integration\n\n### Django ORM Performance Analysis\n\n```python\n# Real-time ORM analysis with middleware (fastest setup)\n# settings.py\nMIDDLEWARE = ['dbcrust.django.PerformanceAnalysisMiddleware', ...]\n\n# Or manual analysis\nfrom dbcrust.django import analyzer\nwith analyzer.analyze() as analysis:\n books = Book.objects.all()\n for book in books:\n print(book.author.name) # Detects N+1 automatically\n\nresults = analysis.get_results() # Get optimization recommendations\n```\n\n**Perfect for Django teams:** N+1 detection, performance monitoring, CI/CD integration, and real-time optimization suggestions.\n\n[**\ud83d\udcd6 Complete Django Integration Guide \u2192**](https://clement-tourriere.github.io/dbcrust/django-analyzer/)\n\n## Python API\n\n```python\nimport dbcrust\n\n# Direct command execution\nresult = dbcrust.run_command(\"postgres://user:pass@localhost/mydb\", \"SELECT * FROM users LIMIT 10\")\n\n# Launch interactive CLI from Python\ndbcrust.run_cli(\"postgres://user:pass@localhost/mydb\")\n\n# PostgresClient class for object-oriented usage\nfrom dbcrust import PostgresClient\nclient = PostgresClient(host=\"localhost\", user=\"postgres\", dbname=\"myapp\")\ntables = client.list_tables()\n```\n\n[**\ud83d\udcd6 Complete Python API Documentation \u2192**](https://clement-tourriere.github.io/dbcrust/python-api/)\n\n## Documentation & Support\n\n- **[\ud83d\udcda Complete Documentation](https://clement-tourriere.github.io/dbcrust/)** - Installation, usage guides, and API reference\n- **[\ud83d\udd27 Command Reference](https://clement-tourriere.github.io/dbcrust/reference/backslash-commands/)** - All 40+ interactive commands\n- **[\ud83d\udc0d Django Integration](https://clement-tourriere.github.io/dbcrust/django-analyzer/)** - ORM performance analysis\n- **[\ud83d\udc1b Issues & Support](https://github.com/clement-tourriere/dbcrust/issues)** - Bug reports and questions\n- **[\ud83d\udce6 PyPI Package](https://pypi.org/project/dbcrust/)** - Python package information\n\n---\n\n**Built with \u2764\ufe0f using [Rust](https://www.rust-lang.org/) \u2022 Modern database CLI \u2022 Security-first architecture**\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "High-performance database CLI engineered for Django developers \u2014 Advanced ORM analysis, performance optimization, SSH tunneling, and seamless multi-database support (PostgreSQL, MySQL, SQLite)",
"version": "0.21.4",
"project_urls": {
"Bug Tracker": "https://github.com/clement-tourriere/dbcrust/issues",
"Changelog": "https://github.com/clement-tourriere/dbcrust/blob/main/CHANGELOG.md",
"Documentation": "https://github.com/clement-tourriere/dbcrust#readme",
"Homepage": "https://github.com/clement-tourriere/dbcrust",
"Repository": "https://github.com/clement-tourriere/dbcrust",
"Source Code": "https://github.com/clement-tourriere/dbcrust"
},
"split_keywords": [
"dbcrust",
" database",
" postgres",
" mysql",
" sqlite",
" cli",
" interactive",
" sql",
" postgresql",
" mysql",
" sqlite",
" ssh-tunnel",
" vault",
" docker",
" django",
" orm",
" python-library",
" performance-analysis",
" n-plus-one"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "29d7821ddce5d156721e634d3aa26cb41548136d93e89b037e959f03425e5f98",
"md5": "18dfe63d277b7471df4486f9055ecd33",
"sha256": "1bdc354808611ca8387c3b676684b3c7357ddfffbb1290c4f5c34dc6b046c388"
},
"downloads": -1,
"filename": "dbcrust-0.21.4-cp38-abi3-macosx_10_12_x86_64.whl",
"has_sig": false,
"md5_digest": "18dfe63d277b7471df4486f9055ecd33",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.10",
"size": 4491586,
"upload_time": "2025-09-05T07:21:31",
"upload_time_iso_8601": "2025-09-05T07:21:31.151835Z",
"url": "https://files.pythonhosted.org/packages/29/d7/821ddce5d156721e634d3aa26cb41548136d93e89b037e959f03425e5f98/dbcrust-0.21.4-cp38-abi3-macosx_10_12_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "561916a2077d58b795b9f74dba25960bf8dddf3c776067ff17ad0d53ab98c493",
"md5": "0b939daebbe7660689477fea5ab2d9d9",
"sha256": "1aa1bc2d41b681673625b4cd9d7742fbd16eecd22ac5277a5f6efc1da2d3d4dd"
},
"downloads": -1,
"filename": "dbcrust-0.21.4-cp38-abi3-macosx_11_0_arm64.whl",
"has_sig": false,
"md5_digest": "0b939daebbe7660689477fea5ab2d9d9",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.10",
"size": 4258015,
"upload_time": "2025-09-05T07:21:33",
"upload_time_iso_8601": "2025-09-05T07:21:33.690295Z",
"url": "https://files.pythonhosted.org/packages/56/19/16a2077d58b795b9f74dba25960bf8dddf3c776067ff17ad0d53ab98c493/dbcrust-0.21.4-cp38-abi3-macosx_11_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "911c6fb527509baacec207ec340bc123c3c1cfe2b402634b6038136eba44fa9d",
"md5": "5d929b8a3b2c704a26cdf2e44476da8f",
"sha256": "746c8c8a5872ad74b15b137d43709ef56851745d2ea2e62588c09bd6b5eee553"
},
"downloads": -1,
"filename": "dbcrust-0.21.4-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"has_sig": false,
"md5_digest": "5d929b8a3b2c704a26cdf2e44476da8f",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.10",
"size": 4718023,
"upload_time": "2025-09-05T07:21:35",
"upload_time_iso_8601": "2025-09-05T07:21:35.631718Z",
"url": "https://files.pythonhosted.org/packages/91/1c/6fb527509baacec207ec340bc123c3c1cfe2b402634b6038136eba44fa9d/dbcrust-0.21.4-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "794a4fc334c3a0f086868a6047fd300cebf511284d3cbef785e6d9b80f89a589",
"md5": "7647ea39a3b4d435ef668b56f44f8c3b",
"sha256": "3a7b5ea1614dd6af8878c358166d7af33319fba5f3b4bae961b0ab5c02435763"
},
"downloads": -1,
"filename": "dbcrust-0.21.4-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl",
"has_sig": false,
"md5_digest": "7647ea39a3b4d435ef668b56f44f8c3b",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.10",
"size": 4846392,
"upload_time": "2025-09-05T07:21:37",
"upload_time_iso_8601": "2025-09-05T07:21:37.380823Z",
"url": "https://files.pythonhosted.org/packages/79/4a/4fc334c3a0f086868a6047fd300cebf511284d3cbef785e6d9b80f89a589/dbcrust-0.21.4-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "30838808b4b69adeabb8c162e23b6eecbf9a828fa4f7e8c0433d1a65d58080f7",
"md5": "3e68fb9a7e5ff0d50211abc0996b2e28",
"sha256": "01cca4cf48c11a543429ac9e41de4d00ade0ecaa31b8e0ebd6adfeada4f4e14c"
},
"downloads": -1,
"filename": "dbcrust-0.21.4-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "3e68fb9a7e5ff0d50211abc0996b2e28",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.10",
"size": 4942757,
"upload_time": "2025-09-05T07:21:39",
"upload_time_iso_8601": "2025-09-05T07:21:39.428897Z",
"url": "https://files.pythonhosted.org/packages/30/83/8808b4b69adeabb8c162e23b6eecbf9a828fa4f7e8c0433d1a65d58080f7/dbcrust-0.21.4-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "cd52a097746f4a31f79f26d121912e6b742f420ee36a55e84d66e7d9cb12bebd",
"md5": "8fd8c6636302938f8c7590d1b2d60ed7",
"sha256": "a087c009918e0b38c51089b5f39471db80b5bac9e8e07be9c4eab5c72871e511"
},
"downloads": -1,
"filename": "dbcrust-0.21.4-cp38-abi3-musllinux_1_2_aarch64.whl",
"has_sig": false,
"md5_digest": "8fd8c6636302938f8c7590d1b2d60ed7",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.10",
"size": 4939468,
"upload_time": "2025-09-05T07:21:41",
"upload_time_iso_8601": "2025-09-05T07:21:41.542763Z",
"url": "https://files.pythonhosted.org/packages/cd/52/a097746f4a31f79f26d121912e6b742f420ee36a55e84d66e7d9cb12bebd/dbcrust-0.21.4-cp38-abi3-musllinux_1_2_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "1b8ceed0c2fd8e12974004ab0cd53e622118c1029b8e3350e6c30c2156060cdf",
"md5": "6ba2e6f1c3254b54591ec01d81c2cc3a",
"sha256": "fa09d44be9970b0cbd16bcf1e459a22d1b6b71dfa08ee446b423822e13e01056"
},
"downloads": -1,
"filename": "dbcrust-0.21.4-cp38-abi3-musllinux_1_2_x86_64.whl",
"has_sig": false,
"md5_digest": "6ba2e6f1c3254b54591ec01d81c2cc3a",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.10",
"size": 5116847,
"upload_time": "2025-09-05T07:21:43",
"upload_time_iso_8601": "2025-09-05T07:21:43.057459Z",
"url": "https://files.pythonhosted.org/packages/1b/8c/eed0c2fd8e12974004ab0cd53e622118c1029b8e3350e6c30c2156060cdf/dbcrust-0.21.4-cp38-abi3-musllinux_1_2_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "349a1c1fb5eb55ec3bd085f958ced81b792275bac07ae0f8e19e64980aaa048f",
"md5": "5ab729575ad5f4e84ecc984e7b779e3f",
"sha256": "8eab7fd36a372b7105c2b727b9d3f3e7fbb8206d7f15191a93a65273aec11249"
},
"downloads": -1,
"filename": "dbcrust-0.21.4-cp38-abi3-win_amd64.whl",
"has_sig": false,
"md5_digest": "5ab729575ad5f4e84ecc984e7b779e3f",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.10",
"size": 4430245,
"upload_time": "2025-09-05T07:21:45",
"upload_time_iso_8601": "2025-09-05T07:21:45.039515Z",
"url": "https://files.pythonhosted.org/packages/34/9a/1c1fb5eb55ec3bd085f958ced81b792275bac07ae0f8e19e64980aaa048f/dbcrust-0.21.4-cp38-abi3-win_amd64.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-05 07:21:31",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "clement-tourriere",
"github_project": "dbcrust",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "dbcrust"
}