badpixxel / paddock-mysql
Paddock - Sql Extension
Package info
gitlab.com/paddock-project/paddock-sql
Type:bundle
pkg:composer/badpixxel/paddock-mysql
Requires
- php: ^7.4|^8.0
- badpixxel/paddock-core: ^4.0
- doctrine/doctrine-bundle: ^2.6
- doctrine/doctrine-fixtures-bundle: ^3.4
- doctrine/doctrine-migrations-bundle: ^3.1
- doctrine/orm: ^2.10
Requires (Dev)
- badpixxel/php-sdk: ^2.0
- doctrine/dbal: ^2.0
- gedmo/doctrine-extensions: ^3.0
- liip/test-fixtures-bundle: ^2.0
- sonata-project/doctrine-orm-admin-bundle: ^4.0
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
| Version | PHP | Paddock Core | Doctrine ORM | Status |
|---|---|---|---|---|
| 5.x | ^8.1 | ^5.0 | 2.20 / 3.x | Active |
| 4.x | ^7.4 | 4.x | 2.x | Maintenance |
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
| Code | Collected Data |
|---|---|
mysql-variable | MySql server variables (i.e @@GLOBAL.xxx) |
mysql-orm-entity | Doctrine 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 anorm-{entity}-checktrack verifying entities integrity via your own QueryBuilder rulesGdprArchivedInterface/GdprSoftDeletableInterface/GdprRemovableInterface— register anorm-{entity}-gdprtrack 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.