badpixxel/paddock-mysql

Paddock - Sql Extension

Maintainers

Package info

gitlab.com/paddock-project/paddock-sql

Issues

Type:bundle

pkg:composer/badpixxel/paddock-mysql

Transparency log

Statistics

Installs: 6 266

Dependents: 3

Suggesters: 0

Stars: 0

4.0.0 2026-07-20 16:26 UTC

This package is auto-updated.

Last update: 2026-07-20 14:34:22 UTC


README

Paddock extension for monitoring SQL servers & Doctrine ORM entities: server variables checks (with auto-fixers), entities integrity analysis, and GDPR lifecycle management (archive, soft-delete, remove), with optional Sonata Admin integration.

Requirements

  • PHP 8.1+
  • badpixxel/paddock-core ^5.0 (Symfony 5.4 → 8.x)
  • Doctrine ORM ^2.20|^3.0, DBAL ^3.6|^4.0
VersionPHPPaddock CoreDoctrine ORMStatus
5.x^8.1^5.02.20 / 3.xActive
4.x^7.44.x2.xMaintenance

Installation

composer require badpixxel/paddock-mysql

Configure the connection via the DATABASE_URL environment variable:

DATABASE_URL="mysql://user:password@my-server.com:3306/mydb"

Available Collectors

CodeCollected Data
mysql-variableMySql server variables (i.e @@GLOBAL.xxx)
mysql-orm-entityDoctrine ORM entities counts & analysis

Server Variables Checks

tracks:

    my-mysql-checks:
        collector:      "mysql-variable"
        description:    "Check MySql Configuration"
        rules:
            "@@GLOBAL.max_allowed_packet":  { gte: "4M" }
            "@@GLOBAL.performance_schema":  { eq: "1" }
            # With Auto-Fixer
            "@@GLOBAL.connect_timeout":     { eq: "10", fixers: [ "mysql-var-fixer" ] }

Entities Integrity & GDPR

Implement the provided interfaces on your Doctrine entities to register automatic verification tracks:

  • PaddockIntegrityInterface — registers an orm-{entity}-check track verifying entities integrity via your own QueryBuilder rules
  • GdprArchivedInterface / GdprSoftDeletableInterface / GdprRemovableInterface — register an orm-{entity}-gdpr track verifying (and fixing, with --fix) entities GDPR lifecycle: archive after X, soft-delete after Y, remove after Z

Helpers are provided: Traits/ArchivedEntityTrait (mapping included, as PHP attributes), Gedmo SoftDeleteable support, and a Sonata Admin extension (Admin/Extension/GdprOutdatedExtension) to expose GDPR states in your admin.

See tests/Entity/ for complete examples (archived, soft-deletable, removable & hybrid entities).

Development & Tests

All checks run identically in CI and locally: the GitLab pipeline executes the exact same commands as the docker containers (one per Symfony version, 5.4 → 8.x), with a mysql:8.0 service alongside:

# Start all containers & run everything (composer, quality, tests)
make verify

# Run PhpUnit tests in all containers
make test

# Quality suites (GrumPHP: lint, code style, PhpStan)
php vendor/bin/grumphp run --testsuite=travis
php vendor/bin/grumphp run --testsuite=csfixer
php vendor/bin/grumphp run --testsuite=phpstan

# PhpUnit testsuites
vendor/bin/phpunit --testsuite=integration
vendor/bin/phpunit --testsuite=operational

License

Paddock is released under the MIT License.