FastHTML-based web editor for DBGear schema and data management
Project description
DBGear Editor
FastHTML-based web interface for viewing and managing DBGear projects with dynamic project switching capabilities.
🚀 Features
- Web-based Interface: Modern FastHTML-powered web UI
- Dynamic Project Switching: Switch between multiple DBGear projects without restart
- Schema Visualization: View tables, views, procedures, and triggers
- Dependencies Mapping: Visualize relationships between database objects
- Project Management: Add, switch, and manage multiple projects
- Persistent Configuration: Settings saved to
~/.dbgear/editor_config.json
📦 Installation
From PyPI (when available)
pip install dbgear-editor
From Source
git clone <repository>
cd dbgear.feature-editor/packages/dbgear-editor
pip install -e .
🏃 Usage
Command Line
# Start with default project
dbgear-editor
# Specify project directory
dbgear-editor --project /path/to/project
# Custom host and port
dbgear-editor --host 0.0.0.0 --port 8080
# Enable auto-reload for development
dbgear-editor --reload
Web Interface
- Open
http://localhost:8000in your browser - Use the project dropdown in the header to switch between projects
- Click the
+button or navigate to/projects/addto add new projects - Navigate using the sidebar to explore schemas and database objects
🐳 Docker Usage
Build and Run
# Build the image
cd packages/dbgear-editor
docker build -t dbgear-editor .
# Run with project directory mounted
docker run -p 8000:8000 \
-v /path/to/your/projects:/app/data/projects:ro \
dbgear-editor
With Specific Project
# Start with a specific project
docker run -p 8000:8000 \
-v /path/to/project:/app/data/my-project:ro \
-e PROJECT_PATH=/app/data/my-project \
dbgear-editor
Persistent Configuration
# Persist settings across container restarts
docker run -p 8000:8000 \
-v dbgear-config:/home/dbgear/.dbgear \
-v /path/to/projects:/app/data/projects:ro \
dbgear-editor
Environment Variables
| Variable | Description | Default |
|---|---|---|
PROJECT_PATH |
Auto-load project path on startup | None |
PYTHONPATH |
Python module search path | /app |
🗂️ Project Structure
DBGear Editor expects projects to have the following structure:
project-directory/
├── project.yaml # DBGear project configuration
├── schema.yaml # Schema definitions
└── data/ # Optional data files
├── schema_name/
│ └── table_name.dat
└── ...
⚙️ Configuration
Settings are automatically saved to ~/.dbgear/editor_config.json:
{
"version": "1.0",
"current_project": "/path/to/current/project",
"recent_projects": [
{
"name": "Project Name",
"path": "/path/to/project",
"last_accessed": "2025-01-09T10:30:00Z"
}
]
}
🔧 Development
Prerequisites
- Python 3.12+
- Poetry (optional, for dependency management)
Setup
# Clone repository
git clone <repository>
cd dbgear.feature-editor
# Install in development mode
cd packages/dbgear-editor
pip install -e .
# Or with poetry
poetry install
Running in Development Mode
# With auto-reload
dbgear-editor --reload --project /path/to/test/project
# Docker development
docker run -p 8000:8000 \
-v $(pwd):/app \
-v /path/to/projects:/app/data/projects:ro \
dbgear-editor --reload
🛠️ Troubleshooting
Common Issues
-
Project not loading
- Ensure
project.yamlexists in the project directory - Check file permissions
- Verify the project path is correct
- Ensure
-
Docker permission issues
# Run with specific user docker run --user $(id -u):$(id -g) -p 8000:8000 dbgear-editor
-
Port already in use
# Use different port dbgear-editor --port 8080
Logs and Debugging
# Check container logs
docker logs <container_id>
# Access container shell
docker exec -it <container_id> bash
# Verbose startup
docker run -p 8000:8000 -e PYTHONUNBUFFERED=1 dbgear-editor
📝 Version History
v0.7.0
- ✅ Dynamic Project Switching: Switch between projects without restart
- ✅ Settings Persistence: Configuration saved automatically to
~/.dbgear/editor_config.json - ✅ Enhanced UI: MonsterUI Select dropdown with project path display
- ✅ Project Management: Dedicated management page at
/projects/add - ✅ Dynamic Page Titles: Format
schema@table (project_path)for better tab identification - ✅ Clean Architecture: Removed JavaScript dependencies and Label components
- ✅ Docker Support: Single-stage build for development efficiency
v0.6.0
- FastHTML-based web interface
- Schema visualization
- Dependencies mapping
- 3-pane layout system
🤝 Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
📄 License
This project is licensed under the MIT License.
Copyright (c) 2022 tamuto
See the LICENSE file for details.
🔗 Links
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dbgear_editor-0.8.1.tar.gz.
File metadata
- Download URL: dbgear_editor-0.8.1.tar.gz
- Upload date:
- Size: 28.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.12.3 Linux/5.15.136-tegra
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
188b38f1b75f5980d3afd70d808144032642bad537ef6e69dded85c60b34e7bb
|
|
| MD5 |
3a8f20433c0eb7585d5dacccc9cb02cd
|
|
| BLAKE2b-256 |
b33d7e0c809745ef193fa10192eee7b92d8a278eefe4ea44fbeab1929943173d
|
File details
Details for the file dbgear_editor-0.8.1-py3-none-any.whl.
File metadata
- Download URL: dbgear_editor-0.8.1-py3-none-any.whl
- Upload date:
- Size: 39.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.12.3 Linux/5.15.136-tegra
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e2960cdd2078df811fd888476a3fcb593f2e465c74c5d4f4e94d1c993ce6d11
|
|
| MD5 |
e6104461cf38a803d6b6aecb74991a3e
|
|
| BLAKE2b-256 |
97fcb1cbb2b1f2db6c978492c5345aa8caa6008b5f857a4d4f9376fb41a4c380
|