antonmarin / traceable-pdo
Wrapper for PDO that adds trace of statement source to analyze slow SQL statements in real-time
Installs: 1 062
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^5.6 || ^7.0
- ext-pdo: *
- ext-zlib: *
Requires (Dev)
- ext-pdo_sqlite: *
- codeclimate/php-test-reporter: ^0.4.1
- phpunit/phpunit: ^5.7
This package is auto-updated.
Last update: 2024-01-29 01:19:22 UTC
README
Adds trace to your sql statement
Usage
When you use traceablePDO\PDO
your statement looks like
SELECT 1 /* eJxT0NdSKM7PTVUoKUpMTlUoLinKzEtX0NIHAF05B60= */
so to get trace you should just enter in your terminal
php -r 'echo gzuncompress(base64_decode("eJxT0NdSKM7PTVUoKUpMTlUoLinKzEtX0NIHAF05B60="));'
Examples
Yii2
config/main.php
... 'db' => [ 'class' => yii\db\Connection::class, 'dsn' => 'mysql:host=localhost;dbname=stay2', 'username' => 'root', 'password' => 'pass', 'charset' => 'utf8', 'pdoClass' => antonmarin\TraceablePDO\PDO::class, // this line adds traces ], ...