Skip to content

DDEV Projects

DevDb Pro provides seamless zero-config integration with DDEV-managed applications, automatically discovering and connecting to your containerized databases.

What is DDEV?

DDEV is an open-source tool for running local web development environments using Docker. It's popular for PHP, Node.js, and Python projects.

Zero-Config Discovery

DevDb automatically detects DDEV projects and connects to their databases without any manual configuration.

How It Works

  1. Open a DDEV project in VS Code
  2. DevDb detects DDEV configuration files
  3. Auto-connects to containerized database
  4. Start browsing your data immediately

Requirements

  • DDEV installed and configured on your system
  • Project initialized with DDEV (ddev config)
  • DDEV running (ddev start)

Supported Databases

DevDb works with all DDEV-supported databases:

  • MySQL/MariaDB (most common)
  • PostgreSQL
  • SQLite (if used in project)

Features

Automatic Container Detection

DevDb intelligently discovers:

  • Container names from DDEV config
  • Database credentials from DDEV environment
  • Port mappings for host access
  • Database names and types

Real-Time Connection

  • Updates automatically when DDEV restarts
  • Reconnects if container restarts
  • Handles multiple projects simultaneously

Full DevDb Features

All DevDb features work with DDEV:

Multi-Project Support

DevDb handles multiple DDEV projects:

Workspace Setup

If you have multiple DDEV projects:

  1. Open each project in VS Code
  2. DevDb lists all databases in the sidebar
  3. Switch between projects by clicking connections
  4. Each maintains independent state

Example Setup

workspace/
├── project-a/          # DDEV project (MySQL)
├── project-b/          # DDEV project (PostgreSQL)
└── project-c/          # Non-DDEV project

DevDb auto-detects:

  • project-a → MySQL connection
  • project-b → PostgreSQL connection
  • project-c → Uses manual config if needed

DDEV-Specific Workflows

Database Inspection

  1. Start DDEV (ddev start)
  2. Open DevDb (Cmd+K Cmd+D or Ctrl+K Ctrl+D)
  3. Browse tables immediately
  4. No setup required

Data Seeding

  1. Create seed data in DevDb
  2. Export as SQL using Data Export
  3. Import to DDEV (ddev import-db)
  4. Or run SQL directly in DevDb

Development Testing

  1. Edit data directly in DevDb
  2. Test your app with modified data
  3. Reset database with ddev snapshot restore when needed
  4. Repeat as needed

Migration Verification

After running migrations:

  1. Refresh DevDb connection
  2. Check schema in Schema viewer
  3. Verify columns and constraints
  4. Add test data to validate

Configuration Files

DevDb reads these DDEV files:

  • .ddev/config.yaml - Main DDEV configuration
  • .ddev/docker-compose.yaml - Container setup (if customized)

Example .ddev/config.yaml:

yaml
name: my-project
type: php
docroot: public
php_version: "8.2"
webserver_type: nginx-fpm
router_http_port: "80"
router_https_port: "443"
database:
  type: mysql
  version: "8.0"

DevDb extracts:

  • Database type (MySQL)
  • Version (8.0)
  • Container name
  • Credentials

Troubleshooting

Database Not Detected

If DevDb doesn't find your DDEV database:

  1. Verify DDEV is running: ddev describe
  2. Check config file exists: .ddev/config.yaml
  3. Restart DDEV: ddev restart
  4. Reload VS Code window

Connection Issues

If connection fails:

  1. Check DDEV status: ddev status
  2. View logs: ddev logs -f db
  3. Verify database is healthy: ddev mysql (for MySQL)
  4. Restart containers: ddev restart

Multiple Projects Conflict

If projects interfere:

  1. Check project names are unique in .ddev/config.yaml
  2. Verify ports don't conflict
  3. Stop unused projects: ddev stop
  4. Restart DevDb connection

Performance Issues

For large databases:

  1. Use filters in DevDb to limit results
  2. Enable pagination for big tables
  3. Check DDEV resources: ddev debug resources
  4. Increase container memory if needed

Advanced Usage

Custom Database Ports

If you've customized DDEV ports:

  1. DevDb reads port mappings automatically
  2. No manual config needed
  3. Connects on correct port

Example custom config:

yaml
# .ddev/config.yaml
host_db_port: "33060"

DevDb uses port 33060 automatically.

Multiple Databases

For projects with multiple databases:

  1. Configure in .ddev/config.yaml:
yaml
additional_databases:
  - analytics
  - logs
  1. DevDb lists all databases
  2. Switch between them in sidebar

Remote DDEV

For remote DDEV installations:

  1. Use VS Code Remote SSH
  2. Open DDEV project remotely
  3. DevDb works the same way
  4. Connects through SSH tunnel

Integration with Other Tools

Combine with Laravel

For Laravel projects in DDEV:

  • Laravel features work fully
  • Code Lens for Eloquent models
  • Factory generation
  • Query explainer

Use with MCP

Enable AI assistance:

  1. Setup MCP per MCP Server docs
  2. AI accesses DDEV database schema
  3. Generate code with context

Export and Import

  1. Export from DevDb (JSON or SQL)
  2. Import to DDEV: ddev import-db < export.sql
  3. Or use DDEV snapshots: ddev snapshot

Best Practices

Development Workflow

  1. Start DDEV before opening VS Code
  2. Let DevDb auto-connect
  3. Use Quick Table Access for navigation
  4. Export data before destructive operations

Team Setup

  1. Document DDEV setup in project README
  2. Share .ddev config in version control
  3. Exclude database dumps from git
  4. Use consistent DDEV versions across team

Performance

  1. Stop unused DDEV projects
  2. Use filters for large tables
  3. Snapshot frequently for quick resets
  4. Monitor resources with ddev debug

Next Steps

DevDb Pro - Zero-config database management for VS Code