StreamlitDBAdmin provides an interactive and user-friendly interface to manage and interact with various databases. Easily view, edit, and manage your database schemas and tables right from the web interface.
- Database Connection: Connect to various database types with specified credentials.
- Schema and Table Viewing: Retrieve and display a list of schemas and tables.
- Table Data Viewing and Editing: View paginated table data and edit it directly within the interface.
- Error Handling and Logging: Robust error handling and logging for troubleshooting.
- Performance Optimization: Utilizes connection pooling for efficient database connections.
To install StreamlitDBAdmin, follow the steps below:
# Clone the repository
git clone https://github.com/your-username/streamlit-db-admin.git
# Navigate to the directory
cd streamlit-db-admin
# Install the required dependencies
pip install -r requirements.txt
# Run the Streamlit app
streamlit run main.pyOnce the app is running, open your web browser and navigate to http://localhost:8501 to access the tool.
You can configure the database connection by setting the following environment variables:
| Variable | Description | Default |
|---|---|---|
DB_TYPE |
The type of database | postgresql |
DB_DATABASE |
The name of the database | (required) |
DB_HOST |
The host of the database | (required) |
DB_PORT |
The port of the database | (required) |
DB_USER |
The username for the database connection | postgres |
DB_PASSWORD |
The password for the database connection | (required) |
EXCLUDED_TABLES |
Comma-separated list of tables to exclude from truncation | user |
StreamlitDBAdmin includes the following security measures:
- SQL Injection Protection: All table and schema names are validated and properly quoted before use in queries.
- Credential Safety: Database passwords are URL-encoded and redacted from logs and error messages.
- Destructive Operation Safeguards: Truncate and drop operations require typing "CONFIRM" to proceed.
Contributions are welcome! Please read our Contributing Guide for more information on how to contribute.
StreamlitDBAdmin is licensed under the MIT License. See the LICENSE file for more details.