Skip to main content

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

  1. Open http://localhost:8000 in your browser
  2. Use the project dropdown in the header to switch between projects
  3. Click the + button or navigate to /projects/add to add new projects
  4. 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

  1. Project not loading

    • Ensure project.yaml exists in the project directory
    • Check file permissions
    • Verify the project path is correct
  2. Docker permission issues

    # Run with specific user
    docker run --user $(id -u):$(id -g) -p 8000:8000 dbgear-editor
    
  3. 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

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. 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

dbgear_editor-0.8.2.tar.gz (28.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dbgear_editor-0.8.2-py3-none-any.whl (39.2 kB view details)

Uploaded Python 3

File details

Details for the file dbgear_editor-0.8.2.tar.gz.

File metadata

  • Download URL: dbgear_editor-0.8.2.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

Hashes for dbgear_editor-0.8.2.tar.gz
Algorithm Hash digest
SHA256 773bf6d856073416ca159ab1737bc9eb3358254b56b6c7ff86b6dfcb186957d7
MD5 818180d0909894e0e8ffa1e0e21957ff
BLAKE2b-256 eae0b4eceaa028e00aea209f702812be63dce13cb9219ad49e11f83883a59708

See more details on using hashes here.

File details

Details for the file dbgear_editor-0.8.2-py3-none-any.whl.

File metadata

  • Download URL: dbgear_editor-0.8.2-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

Hashes for dbgear_editor-0.8.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f02bd89615b59b7438b678494acc5f433ec283bfc571bf41b2a1d527accc2578
MD5 569ef820c122284d0ccfa54fc5b6cee3
BLAKE2b-256 cc09d559213d0b75e4a0aac3b604714c1c0609db7333d6735436fe093d3bc8b8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page