Download the PHP package jeytekdev/explain-lint-doctrine without Composer
On this page you can find all versions of the php package jeytekdev/explain-lint-doctrine. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jeytekdev/explain-lint-doctrine
More information about jeytekdev/explain-lint-doctrine
Files in jeytekdev/explain-lint-doctrine
Package explain-lint-doctrine
Short Description Doctrine DBAL bridge for jeytekdev/explain-lint — captures queries via a Driver\Middleware and re-runs EXPLAIN on the same connection.
License MIT
Homepage https://github.com/jeytekdev/explain-lint-doctrine
Informations about the package explain-lint-doctrine
jeytekdev/explain-lint-doctrine
Doctrine DBAL bridge for jeytekdev/explain-lint — re-runs EXPLAIN against every query your test suite executes, and fails the build on full table scans, lost indexes, filesort and temporary tables.
Implemented as a Doctrine\DBAL\Driver\Middleware, not the old SQLLogger — SQLLogger is deprecated and has been removed entirely in DBAL 4.x. Compatible with doctrine/dbal: ^3.2 || ^4.0.
Install (2 minutes)
Register the middleware wherever you build your Doctrine\DBAL\Configuration (in a plain DBAL app, or via Symfony's doctrine.yaml):
Symfony (config/packages/doctrine.yaml):
Then wire up the PHPUnit extension (see core README):
Running under Codeception
This package only handles capture (the DBAL Middleware) — the report step
is core's PHPUnit <extensions> mechanism, registered via phpunit.xml.
If your suite runs via vendor/bin/codecept run instead of
vendor/bin/phpunit/pest, that mechanism never fires — Codeception 5
doesn't bootstrap PHPUnit's native extension system. The middleware will
still capture every query, but nothing will ever be analyzed or printed:
no error, no warning, just a report that never appears.
Install jeytekdev/explain-lint-codeception too,
and register it in codeception.yml instead of phpunit.xml. Use
explain-lint:install --config-only (not the plain form) to generate
explain-lint.php without also wiring phpunit.xml, since Codeception never
reads that file.
Known limitation: PDO-only drivers
explain-lint needs the real \PDO handle behind a connection to re-run EXPLAIN on the exact same session. This bridge supports the pdo_mysql and pdo_pgsql drivers only — native drivers (mysqli, pgsql, sqlite3) have no \PDO to hand back, so queries on those simply aren't captured (no error, nothing to analyze).
License
MIT