psqlc - PostgreSQL Management CLI Tool
psqlc is a production-ready, feature-rich command-line interface tool for managing PostgreSQL databases with beautiful output formatting and intelligent auto-detection capabilities.
Features
✨ Key Features:
🚀 Async Operations - Built on asyncpg for high-performance database operations
🎨 Beautiful Output - Rich-formatted tables and colored output for better readability
🔍 Auto-Detection - Intelligently detects Django settings and configuration files
🛡️ Production-Ready - Comprehensive error handling and safe operations
📊 Comprehensive Management - Full database, table, user, and query management
🔒 Security-First - Password prompts and confirmation for destructive operations
🌐 Multi-Format Config - Supports .env, .json, .yaml, and settings.py files
Quick Start
Installation
Install psqlc using pip:
pip install psqlc
Requirements
Python 3.6+
PostgreSQL database server
Required packages: rich, asyncpg, licface, envdot, pwinput
Basic Usage
Show all databases:
psqlc show dbs -U postgres -P yourpassword
Create user and database:
psqlc create myuser mypassword mydb -U postgres -P adminpass
Show tables in database:
psqlc show tables -d mydb
Execute query:
psqlc query -d mydb -q "SELECT * FROM users LIMIT 10"
Table of Contents
User Guide
API Reference
- API Modules
backup_database()create_user_db()describe_table()drop_database()drop_user()execute_query()find_settings_recursive()get_connection()get_db_config_or_args()get_version()load_settings_from_path()main()parse_django_settings()print_exception()rich_print()show_connections()show_databases()show_indexes()show_size()show_tables()show_users()- Core Functions
Additional Information
Indices and tables
Links
GitHub Repository: https://github.com/cumulus13/psqlc
PyPI Package: https://pypi.org/project/psqlc/
Issue Tracker: https://github.com/cumulus13/psqlc/issues
Author: Hadi Cahyadi <cumulus13@gmail.com>
License
This project is licensed under the MIT License - see the LICENSE file for details.