Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Database Tools Laravel Package

jpswade/laravel-database-tools

Laravel Database Tools adds handy Artisan commands to create databases, dump/restore from SQL files or Spatie backups, update charset/collation, optimize MySQL tables, and add SQLite MySQL-compat functions for tests. Ideal for dev workflows.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • DevOps & Database Management Efficiency: Streamlines database operations (backups, imports, optimizations) for Laravel developers, reducing manual CLI overhead and human error. Enables faster iteration during local development and staging environments.
  • Database Migration & Reset Workflows: Supports automated database resets for testing (e.g., db:dump + db:import) without manual intervention, critical for CI/CD pipelines or feature branch isolation.
  • SQLite ↔ MySQL Compatibility: Resolves "no such function" errors in SQLite by emulating MySQL functions via PDO/PHP, enabling seamless local development with SQLite while maintaining parity with production MySQL.
  • Backup Integration: Complements Spatie’s laravel-backup by adding restore functionality (db:getFromBackup), reducing dependency on third-party tools for backup management.
  • Build vs. Buy: Avoids reinventing wheel for common database utilities (e.g., OPTIMIZE TABLE, charset fixes), saving engineering time. Low-risk adoption due to minimal dependencies and Laravel-native design.
  • Roadmap for Database-Centric Features: Foundational for future features like:
    • Automated database health checks (e.g., table optimization triggers).
    • Cross-environment parity tools (e.g., "sync my local SQLite with production MySQL").
    • Integration with Laravel Forge/Vapor for managed database ops.

When to Consider This Package

  • Adopt if:

    • Your team frequently resets databases locally or in staging (e.g., for testing, demos, or onboarding).
    • You use SQLite in development but MySQL in production, and encounter function compatibility issues.
    • You rely on Spatie’s laravel-backup but lack a straightforward way to restore backups programmatically.
    • Your Laravel app’s database operations are manual/prone to errors (e.g., mysqldump CLI calls, ad-hoc imports).
    • You prioritize developer velocity over production-grade features (package is dev-only by design).
  • Look elsewhere if:

    • You need production-grade database management (e.g., automated backups, point-in-time recovery). Use dedicated tools like Spatie Backup, Vault, or AWS RDS.
    • Your team uses non-MySQL/SQLite databases (e.g., PostgreSQL, MongoDB). This package is MySQL/SQLite-focused.
    • You require advanced schema migrations (e.g., Alembic, Flyway). This package handles dumps/imports, not migrations.
    • Your workflows are fully serverless/managed (e.g., PlanetScale, Neon). Manual database ops may not apply.
    • You need enterprise features like role-based access, audit logs, or multi-cloud support. This is a lightweight utility.

How to Pitch It (Stakeholders)

For Executives:

"This package cuts database management time in half for our Laravel devs by automating repetitive tasks like backups, resets, and SQLite/MySQL parity. For example, a developer can now reset their local database with a single command (php artisan db:reset) instead of manually running mysqldump and mysql CLI tools. This reduces onboarding friction and speeds up testing cycles—critical for our [feature X] roadmap. The cost? Minimal: a lightweight dev-only dependency with no production impact. ROI comes from developer productivity gains, not infrastructure changes."

Key Metrics to Track:

  • Reduction in time spent on manual database ops (e.g., "Devs save 2 hours/week on local DB resets").
  • Fewer "broken database" incidents during testing (via automated backups/restores).
  • Faster onboarding for new engineers (consistent DB environments).

For Engineering:

*"This fills gaps in Laravel’s native tooling for database operations. Here’s how we’ll use it:

  1. Local Dev Workflow:
    • Replace ad-hoc mysqldump commands with php artisan db:dump and db:import for consistent environments.
    • Fix SQLite/MySQL function mismatches (e.g., DATE_FORMAT) without hacking queries.
  2. Testing:
    • Automate database resets in CI/CD using db:dump + db:import (e.g., before/after feature branch tests).
  3. Staging:
    • Restore Spatie backups programmatically with db:getFromBackup (e.g., for disaster recovery drills).
  4. Optimizations:
    • Run OPTIMIZE TABLE via Artisan to clean up staging DBs without SSH access.

Why not build this ourselves?

  • Time: This is ~500 lines of code; maintaining it would divert effort from core features.
  • Risk: The package is battle-tested in Laravel’s ecosystem (even if low-starred, it’s a thin wrapper around PDO/MySQLi).
  • Flexibility: Configurable via dbtools.php to match our filesystem/database setups.

Trade-offs:

  • Dev-only: Not for production (as intended).
  • Limited to MySQL/SQLite: If we add PostgreSQL later, we’ll need a separate tool.

Proposal: Let’s pilot this in [Project Y]’s staging environment for database resets. If it reduces incidents by 30%, we’ll roll it out to all Laravel teams."*

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
daikazu/eloquent-salesforce-objects
unseen-codes/chat
romalytar/yammi-jobs-monitoring-laravel
kisame76/filament-db-table-state
nqxcode/laravel-lucene-search
dpfx/laravel-livewire-wizards
workos/workos-php-laravel
sofa/laravel-global-scope
nawasara/auth-primitives
adhocrat-io/arkhe-main
make-dev/orca-harpoon
itsemon245/lamet
baks-dev/dashboard
amoifr/pickle-panther-bundle
make-dev/orca
dmstr/symfony-system-resources-bundle
dmstr/symfony-job-queue-bundle
dmstr/openapi-json-schema-bundle
dmstr/keycloak-security-bundle
dmstr/doctrine-audit-log-bundle